public static bool InsertOS(Models.BLModel.OS model, out string message) { message = null; if (string.IsNullOrEmpty(model.Name)) { message = "Operation system is empty"; return(false); } Models.DBModel.OS oS = new Models.DBModel.OS { Name = model.Name, VersionOS = model.VersionOS }; DBLogic dBLogic = new DBLogic(connectionString); var result = dBLogic.InsertOs(oS); if (!result) { message = "Operation system is not added"; } return(true); }
public static bool DeleteOs(Models.BLModel.OS model, out string message) { message = null; if (model.Id == 0) { message = "Choose record"; return(false); } Models.DBModel.OS os = new Models.DBModel.OS { Name = model.Name, Id = model.Id }; DBLogic dBLogic = new DBLogic(connectionString); var result = dBLogic.DeleteOs(os); if (!result) { message = "Delete 0 rows"; return(false); } return(true); }