예제 #1
0
        public virtual ActionResult SameCifsList(DataSourceRequest command, SameCifModel model, string sort, string sortDir)
        {
            var items = _dqQueService.GetAllSameCifs(model.CUST_NAME, model.CUSTOMER_ID, model.SOL_ID, model.FORACID, command.Page - 1, command.PageSize, string.Format("{0} {1}", sort, sortDir));
            //var logItems = _logger.GetAllLogs(createdOnFromValue, createdToFromValue, model.Message,
            //    logLevel, command.Page - 1, command.PageSize);
            DateTime _today    = DateTime.Now.Date;
            var      gridModel = new DataSourceResult
            {
                Data = items.Select(x => new SameCifModel
                {
                    Id           = x.ID,
                    CUSTOMER_ID  = x.CUSTOMER_ID,
                    FORACID      = x.FORACID,
                    CUST_NAME    = x.CUST_NAME,
                    FREE_CODE_10 = x.FREE_CODE_10,
                    REF_DESC     = x.REF_DESC,
                    SCHM_CODE    = x.SCHM_CODE,
                    BRANCH_NAME  = x.BRANCH_NAME,
                    SOL_ID       = x.SOL_ID,
                }),
                Total = items.TotalCount
            };

            return(Json(gridModel));
        }
예제 #2
0
        public virtual ActionResult AuthList(DataSourceRequest command, SameCifModel model, string sort, string sortDir)
        {
            var identity    = ((CustomPrincipal)User).CustomIdentity;
            var routeValues = System.Web.HttpContext.Current.Request.RequestContext.RouteData.Values;
            //RouteValueDictionary routeValues;

            string goldenRecord = "";

            if (routeValues.ContainsKey("id"))
            {
                goldenRecord = (string)routeValues["id"];
            }

            var items     = _dqQueService.GetAllSameCifs(model.CUST_NAME, goldenRecord, model.SOL_ID, model.FORACID, command.Page - 1, command.PageSize, string.Format("{0} {1}", sort, sortDir));
            var gridModel = new DataSourceResult
            {
                Data = items.Select(x => new SameCifModel
                {
                    Id           = x.ID,
                    CUSTOMER_ID  = x.CUSTOMER_ID,
                    FORACID      = x.FORACID,
                    CUST_NAME    = x.CUST_NAME,
                    FREE_CODE_10 = x.FREE_CODE_10,
                    REF_DESC     = x.REF_DESC,
                    SCHM_CODE    = x.SCHM_CODE,
                    BRANCH_NAME  = x.BRANCH_NAME,
                    SOL_ID       = x.SOL_ID,
                }),
                Total = items.TotalCount
            };

            return(Json(gridModel));
        }
예제 #3
0
        public ActionResult AuthList(string id)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(AccessDeniedView());
            }
            var identity = ((CustomPrincipal)User).CustomIdentity;

            var model = new SameCifModel();

            model.CUSTOMER_ID = id;

            var curBranchList = db.CM_BRANCH.Where(a => a.BRANCH_ID == identity.BranchId);

            model.Branches = new SelectList(curBranchList, "BRANCH_ID", "BRANCH_NAME").ToList();

            model.Branches.Add(new SelectListItem
            {
                Value    = "0",
                Text     = "All",
                Selected = true
            });

            return(View(model));
        }
예제 #4
0
        public virtual ActionResult ExportExcelAll(SameCifModel model)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(AccessDeniedView());
            }
            var items = _dqQueService.GetAllDistinctSameCifs(model.CUST_NAME, model.CUSTOMER_ID);

            try
            {
                byte[] bytes = _exportManager.ExportDocumentsToXlsx(items);
                return(File(bytes, MimeTypes.TextXlsx, "sameCifs.xlsx"));
            }
            catch (Exception exc)
            {
                ErrorNotification(exc);
                return(RedirectToAction("List"));
            }
        }