示例#1
0
        // 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) });
        }
示例#2
0
        // 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));
        }
示例#3
0
        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));
        }
示例#4
0
        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);
        }
示例#5
0
 public bool UpdateCarCustoma(CarCustoma carCustoma)
 {
     return(CarCustomaDAL.UpdateCarCustoma(carCustoma));
 }
示例#6
0
 public int InsertCarCustoma(CarCustoma carCustoma)
 {
     return(CarCustomaDAL.InsertCarCustoma(carCustoma));
 }