예제 #1
0
파일: DB.cs 프로젝트: phrensy/Konstructor
 private void bAdd_Click(object sender, EventArgs e)
 {
     if (nPage == 0)
     {
         FormsAndDS.forClient f1 = new FormsAndDS.forClient();
         clientBindingSource.AddNew();
         f1.clientBindingSource.DataSource = clientBindingSource;
         f1.clientBindingSource.Position = clientBindingSource.Position;
         if (f1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             clientTableAdapter.Update(this.kBD_DataSet);
     }
     if (nPage == 1)
     {
         FormsAndDS.forKomplect f0 = new FormsAndDS.forKomplect();
         komplectBindingSource.AddNew();
         f0.komplectBindingSource.DataSource = komplectBindingSource;
         f0.komplectBindingSource.Position = komplectBindingSource.Position;
         if (f0.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             komplectTableAdapter.Update(this.kBD_DataSet);
     }
     if (nPage == 2)
     {
         FormsAndDS.forPost f2 = new FormsAndDS.forPost();
         postavshikBindingSource.AddNew();
         f2.postavshikBindingSource.DataSource = postavshikBindingSource;
         f2.postavshikBindingSource.Position = postavshikBindingSource.Position;
         if (f2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             postavshikTableAdapter.Update(this.kBD_DataSet);
     }
     //if (nPage == 3)
     //{
     //    FormsAndDS.forShcaf f4 = new FormsAndDS.forShcaf();
     //    shcafBindingSource.AddNew();
     //    f4.shcafBindingSource.DataSource = shcafBindingSource;
     //    f4.shcafBindingSource.Position = shcafBindingSource.Position;
     //    if (f4.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     //        shcafTableAdapter.Update(this.kBD_DataSet);
     //}
     if (nPage == 5)
     {
         FormsAndDS.forSvyazKP f = new FormsAndDS.forSvyazKP();
         dataGridView6.DataSource = GetSvKP();
         if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             f.Close();
             dataGridView6.Refresh();
             dataGridView6.DataSource = GetSvKP();
         }
     }
 }
예제 #2
0
파일: DB.cs 프로젝트: phrensy/Konstructor
 private void bChange_Click_1(object sender, EventArgs e)
 {
     if (nPage == 0)
     {
         FormsAndDS.forClient f1 = new FormsAndDS.forClient();
         f1.clientBindingSource.DataSource = clientBindingSource;
         f1.clientBindingSource.Position = clientBindingSource.Position;
         if (f1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             clientTableAdapter.Update(this.kBD_DataSet);
     }
     if (nPage == 1)
     {
         FormsAndDS.forKomplect f0 = new FormsAndDS.forKomplect();
         f0.komplectBindingSource.DataSource = komplectBindingSource;
         f0.komplectBindingSource.Position = komplectBindingSource.Position;
         if (f0.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             komplectTableAdapter.Update(this.kBD_DataSet);
     }
     if (nPage == 2)
     {
         FormsAndDS.forPost f2 = new FormsAndDS.forPost();
         f2.postavshikBindingSource.DataSource = postavshikBindingSource;
         f2.postavshikBindingSource.Position = postavshikBindingSource.Position;
         if (f2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             postavshikTableAdapter.Update(this.kBD_DataSet);
     }
     if (nPage == 3)
     {
         FormsAndDS.forShcaf f4 = new FormsAndDS.forShcaf();
         f4.shcafBindingSource.DataSource = shcafBindingSource;
         f4.shcafBindingSource.Position = shcafBindingSource.Position;
         if (f4.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             shcafTableAdapter.Update(this.kBD_DataSet);
     }
 }