public OrderItemDTO UpdateOrderItem(UpdateOrderItemDTO updatedRecord) { try { string query = @" UPDATE OrderItems SET ItemID = @ItemID, OrderItemUnitPrice = @OrderItemUnitPrice, OrderItemUnitPriceAfterDiscount = @OrderItemUnitPriceAfterDiscount, OrderItemQty = @OrderItemQty, OrderItemDescription = @OrderItemDescription WHERE OrderItemID = @OrderItemID"; var queryParameters = new DynamicParameters(); queryParameters.Add("@ItemID", updatedRecord.ItemID); queryParameters.Add("@OrderItemDescription", updatedRecord.OrderItemDescription); queryParameters.Add("@OrderItemID", updatedRecord.OrderItemID); queryParameters.Add("@OrderItemQty", updatedRecord.OrderItemQty); queryParameters.Add("@OrderItemUnitPrice", updatedRecord.OrderItemUnitPrice); queryParameters.Add("@OrderItemUnitPriceAfterDiscount", updatedRecord.OrderItemUnitPriceAfterDiscount); int rowsUpdated = Connection.Execute(query, queryParameters, CurrentTrans); return((rowsUpdated > 0) ? GetOrderItemByID(updatedRecord.OrderItemID) : throw noRecordEX); } catch (Exception ex) { throw SqlExceptionHandler.HandleSqlException(ex) ?? ex; } }
public OrderItemDTO UpdateOrderItem(UpdateOrderItemDTO updatedRecord) { try { OrderItemDTO returnModel = UOW.OrderRepo.UpdateOrderItem(updatedRecord); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public ActionResult <OrderItemDTO> UpdateOrderItem(UpdateOrderItemDTO updatedRecord) { try { return(_orderManager.UpdateOrderItem(updatedRecord)); } catch (BaseCustomException ex) { return(BadRequest(ex.Message)); } }
public OrderItemDTO UpdateOrderItem(UpdateOrderItemDTO updatedRecord) { return(_orderService.UpdateOrderItem(updatedRecord)); }