public HttpResponseMessage GetOrderItemDetails(Int64 OrderItemId) { ResponseWithData <OrderItem> _response = new ResponseWithData <OrderItem>(); var _getDetails = _orderItemRepository.FindBy(x => x.OrderItemId == OrderItemId && x.Status == (int)Status.Active && x.IsDeleted == false).FirstOrDefault(); if (_getDetails != null) { _response.Type = "success"; _response.Message = "success"; _response.data = _getDetails; return(Request.CreateResponse(HttpStatusCode.OK, _response)); } else { _response.Type = "error"; _response.Message = "Invalid Order Item"; _response.data = null; return(Request.CreateResponse(HttpStatusCode.OK, _response)); } }
public ActionResult UpdateOrderItemStatus(Int64 OrderItemId, byte Status) { ResponseModel _response = new ResponseModel(); var details = _orderItemRepository.FindBy(x => x.OrderItemId == OrderItemId).FirstOrDefault(); details.Status = Status; details.ModifiedDate = DateTime.Now; details.ModifiedBy = UserAuthenticate.UserId; _orderItemRepository.Update(details); int rows = _orderItemRepository.SaveChanges(); if (rows > 0) { _response.Type = "success"; _response.Message = "Updated successfully"; } else { _response.Type = "error"; _response.Message = "Somehing went wrong"; } return(Json(_response, JsonRequestBehavior.AllowGet)); }