コード例 #1
0
 /// <summary>
 /// Assign the values from the TextBox to the FuelTypeModel Properties. Save the FuelTypeModel in the Database.
 /// Logs the Event in the LogFileName. Closes the Add FuelTypeView
 /// </summary>
 public void AddFuelType()
 {
     LogHelper.WriteToLog("FuelType creation started", LogState.Debug);
     FuelTypeModel            = new FuelTypeModel();
     FuelTypeModel.TypeOfFuel = FuelTypeName;
     FuelTypeModel            = SqliteDataAccess.AddFuelType(FuelTypeModel);
     EventAggregationProvider.EventAggregator.PublishOnUIThread(FuelTypeModel);
     if (FuelTypeModel.TypeOfFuel != null && FuelTypeModel.TypeOfFuel != "")
     {
         LogHelper.WriteToLog("Brand created", LogState.Info);
     }
     TryClose();
 }