Esempio n. 1
0
 //Exit and save
 private void btnExit_Click(object sender, EventArgs e)
 {
     try
     {
         ClsCompany.Save();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.GetBaseException().Message);
     }
     Close();
 }
Esempio n. 2
0
 //Initialize form and load saved data
 public FrmMain()
 {
     InitializeComponent();
     cboSortBy.DataSource    = _SortByList;
     cboSortBy.SelectedIndex = 0;
     //retrive saved stuff
     try
     {
         ClsCompany.Retrieve();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.GetBaseException().Message);
     }
 }
Esempio n. 3
0
 //sends data to new Tour object and saves the tour
 private void btnOK_Click(object sender, EventArgs e)
 {
     //check if tour code exists
     if (txtTourCode.Enabled && ClsCompany.TourList.ContainsKey(txtTourCode.Text))
     {
         MessageBox.Show("A Tour with that Code already exists", "Duplicate Code");
     }
     else
     {
         pushData();
         DialogResult = DialogResult.OK;//returns result of 1 or true
         //save
         try
         {
             ClsCompany.Save();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.GetBaseException().Message);
         }
     }
 }
Esempio n. 4
0
 //submit and save cost
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     ClsCompany.Save();
     Close();
 }