Ejemplo n.º 1
0
        // GET: Parking/tblCards
        #region Danh sách thẻ
        public ActionResult Index(string key = "", string fromdate = "", string todate = "", bool desc = true, string columnquery = "ImportDate", string customerGroup = "", string isCheckByTime = "0", int page = 1, string cardgroup = "")
        {
            int pageSize  = 20;
            int totalItem = 0;
            var str       = new List <string>();

            GetListChildCustomer(str, customerGroup);

            if (string.IsNullOrWhiteSpace(fromdate))
            {
                fromdate = DateTime.Now.ToString("dd/MM/yyy");
            }
            if (string.IsNullOrWhiteSpace(todate))
            {
                todate = DateTime.Now.ToString("dd/MM/yyy");
            }
            var systemConfig = _tblSystemConfigService.GetDefault();
            var list         = _itblCardService.GetAllCartPagingByFirstTSQL(key, fromdate, desc, columnquery, todate, cardgroup, str, isCheckByTime, page, pageSize, ref totalItem);


            var girdMode = PageModelCustom <tblCardCustomViewModel> .GetPage(list, page, pageSize, totalItem);

            //if (systemConfig.FeeName.Contains("TRANSERCO"))
            //{
            //    ViewBag.ListMoney = _itblCardService.GetMoneyByCardNumber();
            //}
            ViewBag.ListMoney = _itblCardService.GetMoneyByCardNumber();
            // ViewBag.System = systemConfig;
            //ViewBag.fromDate = fromdate;
            //ViewBag.toDate = !string.IsNullOrWhiteSpace(todate) ? Convert.ToDateTime(todate).ToString("dd/MM/yyyy HH:mm:59") : DateTime.Now.ToString("dd/MM/yyyy 23:59:59");
            ViewBag.fromdateValue      = fromdate;
            ViewBag.todateValue        = todate;
            ViewBag.KeyWord            = key;
            ViewBag.GroupCustomers     = GetMenuList();
            ViewBag.CustomerId         = customerGroup;
            ViewBag.CardGroupDT        = GetListCardGroups().ToDataTableNullable();
            ViewBag.CardGroupid        = cardgroup;
            ViewBag.isCheckByTimeValue = isCheckByTime;
            ViewBag.ColumnQuery        = columnquery;
            ViewBag.Desc = desc;
            // ViewBag.ISTRANSERCO = systemConfig != null ? (systemConfig.FeeName.Contains("TRANSERCO") ? true : false) : false;
            return(View(girdMode));
        }