Ejemplo n.º 1
0
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var model = new EditOrderModel
            {
                Order       = OrderService.GetOrderDetails(id),
                OrderStatus = OrderHistoryEnu.GetAllOrderStatus(),
                Riders      = UserService.GetUsersByype("0")
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        //[ValidateAntiForgeryToken]
        public ActionResult Edit([Bind(Include = "Id,Status,Address,Instructions,PickedBy,DeliveryCost,Comments")] OrderLocal order)
        {
            var response = OrderService.EditOrder_Admin(order);

            if (response.Status)
            {
                return(RedirectToAction("Index"));
            }
            ModelState.AddModelError(string.Empty, response.Error);
            var refMOdel = new EditOrderModel
            {
                Order       = OrderService.GetOrderDetails(order.Id.ToString()),
                OrderStatus = OrderHistoryEnu.GetAllOrderStatus(),
                Riders      = UserService.GetUsersByype("0")
            };

            return(View(refMOdel));
        }
Ejemplo n.º 3
0
        public JsonResult GetAllOrderStatuses()
        {
            var retModel = new AllOrderStatuses
            {
                Success = false
            };

            try
            {
                retModel.ListStatuses = OrderHistoryEnu.GetAllOrderStatus();
                retModel.Success      = true;
            }
            catch (Exception e)
            {
                retModel.Message = "could not get order statuses.";
                throw;
            }

            return(Json(retModel, JsonRequestBehavior.AllowGet));
        }