da=new SqlDataAdapter (cmd);
. Open () ;. ExecuteNonQuery ();
. Close ();
} (Exception g)
{. Show ( Помилка роботи з базою даних! Подробиці: + g.Message);
}
}
}
}
}System;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;
Agenstvo
{partial class Form1: Form
{Form1 ()
{();
}
void client_Click (object sender, EventArgs e)
{cl=new recipt () ;. Text= Рецепти raquo ;;. ShowDialog ();
}
void chastnNid_Click (object sender, EventArgs e)
{n=new pr () ;. nameT= Preporats raquo ;;. Text= Препорати raquo ;;. ShowDialog ();
}
void conNid_Click (object sender, EventArgs e)
{n=new pr () ;. nameT= Reactiv raquo ;;. Text= Реактиви raquo ;;. ShowDialog ();
}
}
}System;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;
Agenstvo
{partial class pr: Form
{pr ()
{();
}
string nameT=null; con=new connect ();
void nidv_Load (object sender, EventArgs e)
{();
}
void start ()
{request= select * FROM + NameT; .DataSource=con.ConnToDbReturnDT (request);
}
void add_Click (object sender, EventArgs e)
{na=new prAdd () ;. nameT=nameT; .nameForm= add raquo ;;. Text= Додавання raquo ;;. ShowDialog (); ();
} void cheng_Click (object sender, EventArgs e)
{na=new prAdd () ;. nameT=nameT; .nameForm= ch raquo ;;. Text= Зміна raquo ;;. id=dg.SelectedCells [0] .Value.ToString () ;. name=dg.SelectedCells [1] .Value.ToString () ;. size=dg.SelectedCells [2] .Value.ToString () ;. conc=dg.SelectedCells [3] .Value.ToString () ; .ShowDialog (); ();
}
void dell_Click (object sender, EventArgs e)
{request= DELETE FROM + NameT + WHERE id= + Dg.SelectedCells [0] .Value.ToString () ;. ConnToDbCUD (request); ();
}
void sherchbutton_Click (object sender, EventArgs e)
{request= select * FROM + NameT + WHERE names= + sherchtextBox.Text + raquo ;;. DataSource=con.ConnToDbReturnDT (request);
}
}
}System;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;
Agenstvo
{partial class prAdd: Form
{prAdd ()
{();
}
string nameForm=null; string id=null; string name=null; string conc=null; string size=null; string nameT=null;
con=new connect ();
void Seave_Click (object sender, EventArgs e)
{(nameForm == add )
{request= INSERT INTO + NameT + (Names, size, conc) VALUES ( + textBox1.Text + raquo ;, + textBox2.Text + raquo ;, + textBox3.Text + ) raquo ;;. ConnToDbCUD (request);
} if (nameForm == ch )
{request= update + NameT + set names= + TextBox1.Text + raquo ;, size= + TextBox2.Text + raquo ;, conc= + TextBox3.Text + WHERE id= + Id + raquo ;;. ConnToDbCUD (request);
}
}
void nidvAdd_Load (object sender, EventArgs e)
{(nameForm == ch )
{. Text=name; .Text=size; .Text=conc;
}
}
}
}System;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;
Agenstvo
{partial class recipt: Form
{recipt ()...