Exemplo n.º 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");
     }
 }
Exemplo n.º 2
0
 public FrmMain()
 {
     InitializeComponent();
     try
     {
         ClsCompany.Retrieve();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     UpdateDisplay();
 }
Exemplo n.º 3
0
 private void UpdateDisplay()
 {
     lstVehicle.DataSource    = ClsCompany.VehicleList.Values.ToList();
     lstVehicle.DisplayMember = "RegistrationNumber";
     lblValue.Text            = string.Format("{0:C} ", ClsCompany.TotalValue());
 }