コード例 #1
0
        //
        // GET: /ECCFOrder/
        public ActionResult Index(string Filter = "", string OrderConfirmation = "", string e = "")
        {
            ECCFOrderCriterion eccfOrderCriterion = new ECCFOrderCriterion();
            IECCFOrder         eccfOrder          = new ECCFOrderRepository();

            try
            {
                ECCFOrderList            eccfOrderList = eccfOrder.GetECCFOrderList(LastNDays: "30");
                List <ECCFOrderListItem> list          = eccfOrderList.ECCFOrderCollection.Cast <ECCFOrderListItem>().ToList();

                ViewBag.Filter      = Filter;
                ViewBag.EditMessage = Utility.ECCFOrdersActionMessage(OrderConfirmation, "DELETED", e);
                ViewBag.EditValue   = e;

                return(View(list));
            }
            catch (Exception ex)
            {
                ErrorSignal.FromCurrentContext().Raise(ex);
                // NOTE: Not specifing the key will make the Model Error display in the Validation Summary
                Utility.Log(NLogLogger.LogLevel.Error, "Error in Index in ECCFOrderController", GetType().FullName, ex);
                Response.StatusCode = 400;
                ModelState.AddModelError(string.Empty, "An error occured while displaying the page.");
                return(View(new List <ECCFOrderListItem>()));
            }
        }
コード例 #2
0
        public ActionResult GetPartialViewECCFListTable(string lastNDays = "30")
        {
            try
            {
                ECCFOrderCriterion eccfOrderCriterion = new ECCFOrderCriterion();

                IECCFOrder eccfOrder = new ECCFOrderRepository();

                ECCFOrderList eccfOrderList = eccfOrder.GetECCFOrderList(LastNDays: lastNDays);

                List <ECCFOrderListItem> list = eccfOrderList.ECCFOrderCollection.Cast <ECCFOrderListItem>().ToList();

                return(PartialView("_ECCFOrderListTable", list));
            }
            catch (Exception e)
            {
                Utility.Log(NLogLogger.LogLevel.Error, "Error in post GetPartialViewECCFListTable", GetType().FullName, e);
                ErrorSignal.FromCurrentContext().Raise(e);                                                                               // Send error to ELMAH for logging purposes
                return(new HttpStatusCodeResult(400, "Bad Request. Try again. If the problem persists contact the web administrator.")); // Bad Request
            }
        }