Exemple #1
0
        public async Task <IActionResult> Index()
        {
            ViewData["MemberDefaultGroup"] = await _appService.GetParameterValue("MemberDefaultGroup");

            ViewData["MemberDefaultPassword"] = await _appService.GetParameterValue("MemberDefaultPassword");

            ViewData["RegAgreement"] = await _appService.GetParameterValue("RegAgreement");

            ViewData["AutoReg"]    = await _appService.GetParameterValue("AutoReg");;
            ViewData["RegSmsCode"] = await _appService.GetParameterValue("RegSmsCode");

            ViewData["PointPaidPercentLimit"] = await _appService.GetParameterValue("PointPaidPercentLimit");

            ViewData["PointPayPwd"] = await _appService.GetParameterValue("PointPayPwd");

            ViewData["ValuePayPwd"] = await _appService.GetParameterValue("ValuePayPwd");


            ViewData["MemberSignPoint"] = await _appService.GetParameterValue("MemberSignPoint");

            ViewData["BusinessAgreement"] = await _appService.GetParameterValue("BusinessAgreement");

            var levelDropDown = (await _levelAppService.GetDropDown());

            ViewBag.Level = levelDropDown;
            return(View());
        }
        public async Task <IActionResult> List(int page        = 1, int pageSize  = 10, string Level = "", string Name = "",
                                               string Business = "", string Store = "", string RegTimeFrom = "", string RegTimeTo = "")
        {
            //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            //stopwatch.Start(); //  开始监视代码运行时间
            //                   //  需要测试的代码 ....

            string where = string.Empty; where += _comAppService.GetWhere();
            if (!string.IsNullOrEmpty(Level))
            {
                where += $" and c.levelId={Level}";
            }
            if (!string.IsNullOrEmpty(Name))
            {
                where += $" and c.WeChatName like'%{Name}%'";
            }
            if (!string.IsNullOrEmpty(Business))
            {
                where += $" and c.BusinessId={Business}";
            }
            if (!string.IsNullOrEmpty(Store))
            {
                where += $" and c.ChainStoreId={Store}";
            }
            if (!string.IsNullOrEmpty(RegTimeFrom))
            {
                where += $" and c.RegTime>='{RegTimeFrom} 00:00:00'";
            }
            if (!string.IsNullOrEmpty(RegTimeTo))
            {
                where += $" and c.RegTime<='{RegTimeTo} 23:59:59'";
            }

            ViewBag.PageSize = pageSize;
            int        total;
            DataSet    ds       = _AppService.GetPage(page, pageSize, "id desc", out total, where);
            IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total);

            //stopwatch.Stop(); //  停止监视
            //TimeSpan timespan = stopwatch.Elapsed; //  获取当前实例测量得出的总时间
            //double milliseconds = timespan.TotalMilliseconds;  //  总毫秒数
            //Logger.Warn("11111111111111111111111111耗时间:"+ milliseconds.ToString());
            if (Request.Headers.ContainsKey("x-requested-with"))
            {
                return(View("_Table", pageList));
            }

            //var businessDropDown = (await _businessAppService.GetDropDown());
            //ViewData.Add("Business", new SelectList(businessDropDown, "Id", "BusinessName"));

            var levelDropDown = (await _levelAppService.GetDropDown());

            ViewData.Add("Level", new SelectList(levelDropDown, "Id", "Title"));

            var storeDropDown = (await _storeAppService.GetDropDown());

            ViewData.Add("ChainStore", new SelectList(storeDropDown, "Id", "Name"));
            return(View(pageList));
        }
        public async Task <IActionResult> Index()
        {
            var levelDropDown = (await _levelAppService.GetDropDown());

            ViewBag.Level = levelDropDown;


            return(View());
        }
Exemple #4
0
        public async Task <IActionResult> Index(long?id)
        {
            //   ViewBag.Page = new PagedList<DataRow>(null, 1, 1);
            if (id != null)
            {
                ViewBag.CarId = (await _AppService.GetEntity((long)id)).CardID;
            }

            var levelDropDown = (await _levelAppService.GetDropDown());

            ViewData.Add("Level", new SelectList(levelDropDown, "Id", "Title"));

            var storeDropDown = (await _storeAppService.GetDropDown());

            ViewData.Add("ChainStore", new SelectList(storeDropDown, "Id", "Name"));

            string where = _comAppService.GetWhere();
            int     total;
            string  sql = $@"select c.id,c.Title from dbo.TCoupon c where c.id>0";
            DataSet ds  = _couponService.GetPage(1, int.MaxValue, "id desc", out total, where, sql);

            ViewBag.CouponTable = ds.Tables[0];
            return(View());
        }