Exemple #1
0
 //добавить оборудование
 private void add_ob_Click(object sender, EventArgs e)
 {
     dob_ob dOb = new dob_ob();
     dOb.ShowDialog();
     DGW_ob.DataSource = client.GetData("GetOb").Tables[0];
     label2.Text = "Количество записей в таблице:" + DGW_ob.RowCount.ToString();
 }
Exemple #2
0
 private void DGW_ob_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     int currentRow = int.Parse(e.RowIndex.ToString());
     if (DGW_ob.Columns[e.ColumnIndex] == del_ob && currentRow >= 0)
     {
         string i_n = DGW_ob[4, currentRow].Value.ToString();
         client.dob_red_ob(2, "", "", "", "", i_n, "", "","");
         DGW_ob.DataSource = client.GetData("GetOb").Tables[0];
         label2.Text = "Количество записей в таблице:" + DGW_ob.RowCount.ToString();
     }
     if (DGW_ob.Columns[e.ColumnIndex] == redact_ob && currentRow >= 0)
     {
         dob_ob ro = new dob_ob();
         ro.nom_a = DGW_ob[2, currentRow].Value.ToString();
         ro.kor = DGW_ob[3, currentRow].Value.ToString();
         ro.invent_n = DGW_ob[4, currentRow].Value.ToString();
         ro.n_ob = DGW_ob[5, currentRow].Value.ToString();
         ro.cost = DGW_ob[6, currentRow].Value.ToString();
         ro.ot_lic = DGW_ob[7, currentRow].Value.ToString();
         ro.d_u = DGW_ob[8, currentRow].Value.ToString();
         ro.d_s = DGW_ob[9, currentRow].Value.ToString();
         ro.flag = 0;
         ro.ShowDialog();
         DGW_ob.DataSource = client.GetData("GetOb").Tables[0];
         label2.Text = "Количество записей в таблице:" + DGW_ob.RowCount.ToString();
     }
 }