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