public bool DeleteFuelType(int fuelTypeID) { string sql = " Delete FuelTypes where FuelTypeID =" + fuelTypeID; db = new DBAccess(); int rows_affected = db.ExecuteNonQuery(sql); if (rows_affected == 1) return true; else return false; }
public bool UpdateFuelType(FuelTypeDTO fuleTypeDTO) { string sql = "update FuelTypes set FuelTypeName='" + fuleTypeDTO.FuleTypeName + @"' where FuelTypeID =" + fuleTypeDTO.FuelTypeID; db = new DBAccess(); int rows_affected = db.ExecuteNonQuery(sql); if (rows_affected == 1) return true; else return false; }
public bool NewFuelType(FuelTypeDTO fuleTypeDTO) { string sql = "Insert into FuleTypes (FuelTypeName) values ("+ "'"+fuleTypeDTO.FuleTypeName+@"')"; db = new DBAccess(); int rows_affected = db.ExecuteNonQuery(sql); if (rows_affected == 1) return true; else return false; }