Exemplo n.º 1
0
 public ActionResult OrderTransferRequestsAllByDriverId(OrderTransferRequestsViewModel orderTransferRequestsViewModel)
 {
     orderTransferRequestsViewModels = new List <OrderTransferRequestsViewModel>();
     try
     {
         PagingParameterModel pagingParameterModel = new PagingParameterModel();
         pagingParameterModel.DriverId = orderTransferRequestsViewModel.DriverId;
         var OrderTransferRquestViewList = webServices.Post(pagingParameterModel, "FuelTransfer/OrderTransferRequestsAllByDriverId");
         if (OrderTransferRquestViewList.StatusCode == System.Net.HttpStatusCode.Accepted)
         {
             orderTransferRequestsViewModels = (new JavaScriptSerializer().Deserialize <List <OrderTransferRequestsViewModel> >(OrderTransferRquestViewList.Data.ToString()));
         }
         return(View("OrderTransferRequestsAll", orderTransferRequestsViewModels));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 public ActionResult OrderTransferRequestsAdminAcceptOrReject(OrderTransferRequestsViewModel orderTransferRequestsViewModel)
 {
     try
     {
         orderTransferRequestsViewModel.AcceptBy = Convert.ToInt32(Session["UserId"]);
         var OrderTransferRquestViewList = webServices.Post(orderTransferRequestsViewModel, "FuelTransfer/OrderTransferRequestsAdminAcceptOrReject");
         if (OrderTransferRquestViewList.StatusCode == System.Net.HttpStatusCode.Accepted)
         {
             orderTransferRequestsViewModel = (new JavaScriptSerializer().Deserialize <OrderTransferRequestsViewModel>(OrderTransferRquestViewList.Data.ToString()));
         }
         if (orderTransferRequestsViewModel.IsAccepted == false)
         {
             return(Redirect(nameof(OrderTransferRequestsAll)));
         }
         else
         {
             return(Json(orderTransferRequestsViewModel, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }