Exemplo n.º 1
0
        public async Task <IActionResult> List(int page         = 1, int pageSize = 10,
                                               string storeName = "", string businessId = "")
        {
            string where = _commonAppService.GetWhere();
            if (!string.IsNullOrEmpty(storeName))
            {
                where = $" and c.Name like '%{storeName}%'";
            }
            if (!string.IsNullOrEmpty(businessId))
            {
                where += $" and c.BusinessId = {businessId}";
            }
            int        total;
            DataSet    ds       = _AppService.GetPage(page, pageSize, "c.sort desc, c.id desc", out total, where);
            IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total);

            if (Request.Headers.ContainsKey("x-requested-with"))
            {
                return(View("_Table", pageList));
            }
            List <BusinessDropDownDto> dtoList = (await _businessAppService.GetDropDown());

            ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(dtoList, "Id", "BusinessName"));
            return(View(pageList));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> List(int pageIndex = 1, int pageSize = 10, string Name = "", string BusinessId = "")
        {
            string where = string.Empty;

            if (!string.IsNullOrEmpty(Name))
            {
                where += $" and Name like '%{Name}%'";
            }
            if (!string.IsNullOrEmpty(BusinessId))
            {
                where += $" and *.BusinessId = {BusinessId}";
            }
            int total;

            DataSet    ds   = _roleAppService.GetRolePage(pageIndex, pageSize, "id desc", out total, where);
            IPagedList page = new PagedList <DataRow>(ds.Tables[0].Select(), pageIndex, pageSize, total);

            if (Request.Headers.ContainsKey("x-requested-with"))
            {
                return(View("_Table", page));
            }
            List <BusinessDropDownDto> businessdtoList = (await _businessAppService.GetDropDown());

            ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(businessdtoList, "Id", "BusinessName"));
            List <BusinessDropDownDto> dtoList = (await _businessAppService.GetDropDown());

            return(View(page));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> List(int page         = 1, int pageSize = 10,
                                               string storeName = "", string businessId = "")
        {
            string where = _commonAppService.GetWhere();
            if (!string.IsNullOrEmpty(storeName))
            {
                where = $" and c.Name like '%{storeName}%'";
            }
            if (!string.IsNullOrEmpty(businessId))
            {
                where += $" and c.BusinessId = {businessId}";
            }
            int        total;
            string     table    = $@"select c.id,c.IsSystem, c.Name,cast(c.AvailablePoint as float) AvailablePoint,
c.AvailableSmsCount,cast(c.AvailableValue as float) AvailableValue,cast( 
c.SettlementMoney as float) SettlementMoney from TChainStore c where 1=1";
            DataSet    ds       = _AppService.GetPage(page, pageSize, "c.sort desc, c.id desc", out total, where, table);
            IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total);

            ViewBag.PageSize = pageSize;
            if (Request.Headers.ContainsKey("x-requested-with"))
            {
                return(View("_Table", pageList));
            }
            List <BusinessDropDownDto> dtoList = (await _businessAppService.GetDropDown());

            ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(dtoList, "Id", "BusinessName"));
            return(View(pageList));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> List(
            int page = 1, int pageSize = 10, string RoleId = "", string Name = "", string BusinessId = "")
        {
            string where = string.Empty;
            if (!string.IsNullOrEmpty(Name))
            {
                where += $" and s.UserName like '%{Name}%'";
            }
            if (!string.IsNullOrEmpty(RoleId))
            {
                where += $" and RoleId = {RoleId}";
            }
            if (!string.IsNullOrEmpty(BusinessId))
            {
                where += $" and r.BusinessId = {BusinessId}";
            }
            int        total;
            DataSet    ds       = _userAppService.GetUserPage(page, pageSize, "id desc", out total, where);
            IPagedList pageList = new PagedList <DataRow>(ds.Tables[0].Select(), page, pageSize, total);


            if (Request.Headers.ContainsKey("x-requested-with"))
            {
                return(View("_Table", pageList));
            }
            List <RoleDropDownDto> dtoList = (await _roleAppService.GetDropDown());

            ViewData.Add("Roles", new SelectList(dtoList, "Id", "DisplayName"));
            List <BusinessDropDownDto> businessdtoList = (await _AppService.GetDropDown());

            ViewData.Add("Business", new Microsoft.AspNetCore.Mvc.Rendering.SelectList(businessdtoList, "Id", "BusinessName"));
            EditUserModalViewModel s = new EditUserModalViewModel();

            s.User           = new UserDto();
            s.Roles          = dtoList;
            ViewBag.EditUser = s;
            return(View(pageList));
        }