public void Post([FromBody] RestaurantPOS_OrderedProductKOT RestaurantPOS_OrderedProductKOT) { if (ModelState.IsValid) { RestaurantPOS_OrderedProductKOTRepository.Add(RestaurantPOS_OrderedProductKOT); } }
public void Put(int OP_ID, [FromBody] RestaurantPOS_OrderedProductKOT RestaurantPOS_OrderedProductKOT) { RestaurantPOS_OrderedProductKOT.OP_ID = OP_ID; if (ModelState.IsValid) { RestaurantPOS_OrderedProductKOTRepository.Update(RestaurantPOS_OrderedProductKOT); } }
public void Update(RestaurantPOS_OrderedProductKOT RestaurantPOS_OrderedProductKOT) { using (IDbConnection dbConnection = Connection) { string sQuery = "UPDATE RestaurantPOS_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,Notes=@Notes" + " WHERE OP_ID = @OP_ID"; dbConnection.Open(); dbConnection.Query(sQuery, RestaurantPOS_OrderedProductKOT); } }
public void Add(RestaurantPOS_OrderedProductKOT RestaurantPOS_OrderedProductKOT) { using (IDbConnection dbConnection = Connection) { string sQuery = " INSERT INTO RestaurantPOS_OrderedProductKOT(TicketID, Dish, Rate, Quantity, Amount, VATPer, VATAmount, STPer, STAmount, SCPer, SCAmount, DiscountPer, DiscountAmount, TotalAmount, Notes )" + " VALUES(@TicketID, @Dish, @Rate, @Quantity, @Amount, @VATPer, @VATAmount,@STPer,@STAmount,@SCPer,@SCAmount,@DiscountPer,@DiscountAmount,@TotalAmount,@Notes)"; dbConnection.Open(); dbConnection.Execute(sQuery, RestaurantPOS_OrderedProductKOT); } }