コード例 #1
0
        public JsonResult CheckCustomerIsBlockOrNotForDO(string chassisNum)
        {
            bool status = false;

            try
            {
                if (ModelState.IsValid)
                {
                    DOServiceClient ServiceClient = new DOServiceClient();
                    status = ServiceClient.CheckCustomerIsBlockOrNotForDO(chassisNum);


                    //if (purchase.Count == 0 || purchase == null)
                    //{
                    //    ModelState.AddModelError("error", "No Record Found");
                    //}
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Wrong");
                status = false;
                throw e;
            }

            //return Json(purchaseReportByDate, JsonRequestBehavior.AllowGet);
            return(Json(new { status = true }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult GetAllDOrders()
        {
            dynamic AllDOrders = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    DOServiceClient service = new DOServiceClient();

                    AllDOrders = service.GetAllDOrders();
                    //if (customer.Count == 0 || customer == null)
                    //{
                    //    ModelState.AddModelError("error", "No Record Found");
                    //}
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Wrong");
                AllDOrders = null;
                throw e;
            }
            return(Json(AllDOrders, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public JsonResult GetCustomerDetails(string prefix)
        {
            dynamic customers = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    DOServiceClient service = new DOServiceClient();
                    customers = service.GetCustomerDetails(prefix);

                    //return Json(customers, JsonRequestBehavior.AllowGet);
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("error", "Something Went Wrong");
                customers = null;
                throw ex;
            }
            return(Json(customers, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public ActionResult DeleteDO(int ID)
        {
            bool status = true;

            try
            {
                if (ModelState.IsValid)
                {
                    DOServiceClient service = new DOServiceClient();
                    status = service.DeleteDO(ID);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Went Wrong");
                status = false;
                throw e;
            }
            //return RedirectToAction("Index");
            //return View();
            return(new JsonResult {
                Data = new { status = status }
            });
        }
コード例 #5
0
        public ActionResult SaveDeliveryOrder(DeliveryOrderModel doModel)
        {
            bool status = true;

            try
            {
                if (ModelState.IsValid)
                {
                    DOServiceClient service = new DOServiceClient();
                    status = service.SaveEdit(doModel);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Went Wrong");
                status = false;
                throw e;
            }
            //return RedirectToAction("Index");
            //return View();
            return(new JsonResult {
                Data = new { status = status }
            });
        }