예제 #1
0
 private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         ClsCompany.Save();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Something went wrong while saving");
     }
 }
예제 #2
0
 public FrmMain()
 {
     InitializeComponent();
     try
     {
         ClsCompany.Retrieve();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     UpdateDisplay();
 }
예제 #3
0
 private void UpdateDisplay()
 {
     lstVehicle.DataSource    = ClsCompany.VehicleList.Values.ToList();
     lstVehicle.DisplayMember = "RegistrationNumber";
     lblValue.Text            = string.Format("{0:C} ", ClsCompany.TotalValue());
 }