示例#1
0
 private void deleteDataBtn_Click(object sender, EventArgs e)//+
 {
     try
     {
         List <MainProfile> mainProfiles = null;
         using (ChooseMainProfileForm dsf = new ChooseMainProfileForm())
         {
             dsf.Type = "delete";
             dsf.ShowDialog();
             if (dsf.Status)
             {
                 mainProfiles = dsf.SelectedMainProfiles;
                 DataManipulationService.DeleteMainProfile(mainProfiles);
                 MessageBox.Show("Данные успешно удалены.");
             }
             else
             {
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
 private void loadDataDBBtn_Click(object sender, EventArgs e)//+
 {
     try
     {
         MainProfile mainProfile = null;
         using (ChooseMainProfileForm cmp = new ChooseMainProfileForm())
         {
             cmp.Type = "load";
             cmp.ShowDialog();
             if (cmp.Status)
             {
                 mainProfile = cmp.SelectedMainProfiles[0];
                 Document    = SortDocument(DataManipulationService.LoadMainProfileDB(mainProfile));
                 if (Document != null)
                 {
                     ShowOnTabControl(Document);
                     InitAutoComplete(questionTB, Document);
                     saveBtn.Enabled         = true;
                     closeProfileBtn.Enabled = true;
                     visDataBtn.Enabled      = true;
                     questionBtn.Enabled     = true;
                     MessageBox.Show("Данные успешно загружены.");
                 }
             }
             else
             {
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + " Исправте ошибки и попытайтесь снова!");
         return;
     }
 }