public void Post([FromBody] TempRestaurantPOS_OrderedProductKOT temp) { if (ModelState.IsValid) { TempRestaurantPOS_OrderedProductKOTRepository.Add(temp); } }
public void Put(int id, [FromBody] TempRestaurantPOS_OrderedProductKOT temp) { temp.OP_ID = id; if (ModelState.IsValid) { TempRestaurantPOS_OrderedProductKOTRepository.Update(temp); } }
public void Add(TempRestaurantPOS_OrderedProductKOT Temp) { using (IDbConnection dbConnection = Connection) { string sQuery = "INSERT INTO TempRestaurantPOS_OrderedProductKOT (TicketID , Dish , Rate, Quantity, Amount, VATPer, VATAmount, STPer, STAmount, SCPer, SCAmount, DiscountPer, DiscountAmount, TotalAmount, T_Number)" + " VALUES(@TicketID , @Dish , @Rate, @Quantity, @Amount, @VATPer, @VATAmount,@STPer,@STAmount,@SCPer,@SCAmount,@DiscountPer,@DiscountAmount,@TotalAmount,@T_Number)"; dbConnection.Open(); dbConnection.Execute(sQuery, Temp); } }
public void Update(TempRestaurantPOS_OrderedProductKOT Temp) { using (IDbConnection dbConnection = Connection) { string sQuery = "UPDATE TempRestaurantPOS_OrderedProductKOT SET TicketID=@TicketID,Dish=@Dish,Rate=@Rate,Quantity=@Quantity," + "Amount=@Amount,VATPer=@VatPer,VATAmount=@VATAmount,STPer=@STPer,STAmount=@STAmount," + "SCPer=@SCPer,SCAmount=SCAmount,DiscountPer=@DiscountPer,DiscountAmount=@DiscountAmount,TotalAmount=@TotalAmount,T_Number=@T_Number" + " WHERE OP_ID = @OP_ID"; dbConnection.Open(); dbConnection.Execute(sQuery, Temp); } }