{();
}
dt=new DataTable (); con=new connect ();
void Clients_Load (object sender, EventArgs e)
{();
}
void clientsStart ()
{request= select * FROM recipt raquo ;;=con.ConnToDbReturnDT (request) ;. DataSource=dt;
}
void add_Click (object sender, EventArgs e)
{cad=new reciptAddDel () ;. nameForm= add raquo ;;. Text= Додавання raquo ;;. ShowDialog (); ();
}
void cheng_Click (object sender, EventArgs e)
{cad=new reciptAddDel () ;. nameForm= ch raquo ;;. name=dg.SelectedCells [1] .Value.ToString () ;. description=dg.SelectedCells [2]. Value.ToString () ;. id=dg.SelectedCells [0] .Value.ToString () ;. Text= Зміна raquo ;;. ShowDialog (); ();
}
void dell_Click (object sender, EventArgs e)
{request= DELETE FROM recipt WHERE id= + Dg.SelectedCells [0] .Value.ToString () ;. ConnToDbCUD (request); ();
}
void sherchbutton_Click (object sender, EventArgs e)
{request= select * FROM recipt where name= + SherchtextBox.Text + raquo ;;
=con.ConnToDbReturnDT (request) ;. DataSource=dt;
}
}
}System;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;
Agenstvo
{
partial class reciptAddDel: Form
{reciptAddDel ()
{();
}
string nameForm=null; con=new connect (); string id=null; string name=null; string description=null;
void Seave_Click (object sender, EventArgs e)
{(nameForm == add )
{request= INSERT INTO recipt (name, description) VALUES ( + textBox1.Text + raquo ;, + textBox2.Text + ) raquo ;;. ConnToDbCUD (request);
} if (nameForm == ch )
{request= update recipt set name= + TextBox1.Text + raquo ;, description= + TextBox2.Text + WHERE id= + Id + raquo ;;. ConnToDbCUD (request);
}
}
void clientAddDel_Load (object sender, EventArgs e)
{(nameForm == ch )
{. Text=name; .Text=description;
}
}
}
}