// PUT api/values/5 public Object Put(int id, [FromBody] string carCustoma) { CarCustoma u = JsonConvert.DeserializeObject <CarCustoma>(carCustoma); u.ID = id; return(new { success = CarCustomaBLL.UpdateCarCustoma(u) }); }
// POST api/values public int Post([FromBody] string carCustoma) { JsonSerializerSettings serializerSettings = new JsonSerializerSettings { Formatting = Formatting.Indented }; CarCustoma u = JsonConvert.DeserializeObject <CarCustoma>(carCustoma, serializerSettings); return(CarCustomaBLL.InsertCarCustoma(u)); }
public int InsertCarCustoma(CarCustoma carCustoma) { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@IDCar", carCustoma.IDCar); parameters.Add("@IDUser", carCustoma.IDUser); parameters.Add("@CarPiecesCustoma", carCustoma.CarPiecesCustoma); parameters.Add("@TotalCustomaValuePerKm", carCustoma.TotalCustomaValuePerKm); return((int)SqlMapper.ExecuteScalar(connection, SQL_INSERIR, parameters)); }
public bool UpdateCarCustoma(CarCustoma carCustoma) { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@ID", carCustoma.ID); parameters.Add("@IDCar", carCustoma.IDCar); parameters.Add("@IDUser", carCustoma.IDUser); parameters.Add("@CarPiecesCustoma", carCustoma.CarPiecesCustoma); parameters.Add("@TotalCustomaValuePerKm", carCustoma.TotalCustomaValuePerKm); return(SqlMapper.Execute(connection, SQL_UPDATE, parameters) > 0); }
public bool UpdateCarCustoma(CarCustoma carCustoma) { return(CarCustomaDAL.UpdateCarCustoma(carCustoma)); }
public int InsertCarCustoma(CarCustoma carCustoma) { return(CarCustomaDAL.InsertCarCustoma(carCustoma)); }