/// <summary> /// This Methods executes after AddModel Button triggers. It writes a logmessage and adds the ModelType to the Database. /// After adding the ModelType to database closes the AddModelView /// </summary> public void AddModelType() { LogHelper.WriteToLog("ModelType creation started", LogState.Debug); ModelTypeModel = new ModelTypeModel(); ModelTypeModel.ModelName = ModelTypeModelName; ModelTypeModel = SqliteDataAccess.AddModel(ModelTypeModel, BrandModel); EventAggregationProvider.EventAggregator.PublishOnUIThread(ModelTypeModel); if (ModelTypeModel != null && ModelTypeModel.ModelName != "") { LogHelper.WriteToLog("ModelType created", LogState.Info); } TryClose(); }