示例#1
0
        //
        // GET: /User/

        public ActionResult Index(string name, int role = 0, int page = 1)
        {
            int count;
            int pageSize = 15;
            var query    = CRL.Package.RoleAuthorize.EmployeeBusiness.Instance.GetLambdaQuery();

            if (!string.IsNullOrEmpty(name))
            {
                query.Where(b => b.Name.Like("%" + name + "%"));
            }
            if (role > 0)
            {
                query.Where(b => b.Role == role);
            }
            query.Page(pageSize, page);
            query.OrderBy(b => b.Id, true);
            //todo 分页
            var list = query.ToList();

            count = query.RowCount;
            var pageObj = new PageObj <CRL.Package.RoleAuthorize.Employee>(list, page, count, pageSize);
            var roles   = CRL.Package.RoleAuthorize.RoleBusiness.Instance.QueryList();

            //var selectList = new SelectList(roles, "id", "Name", "24");
            ViewBag.Role = roles;
            return(View(pageObj));
        }
示例#2
0
        public ActionResult Index(string k, string c = "", int page = 1, int pageSize = 15)
        {
            int count;

            count = 0;
            //使用缓存搜索
            var query = new CRL.ExpressionJoin <Product>(BLL.ProductManage.Instance.AllCache, b => b.ProductStatus == CRL.Package.Product.ProductStatus.已上架);

            if (!string.IsNullOrEmpty(k))
            {
                query.And(b => b.ProductName.Contains(k));
            }
            if (!string.IsNullOrEmpty(c))
            {
                query.And(b => b.CategoryCode.StartsWith(c));
            }

            var products = query.ToList().OrderByDescending(b => b.Id);

            count = products.Count();
            var result  = products.Skip((page - 1) * pageSize).Take(pageSize).ToList();
            var pageObj = new PageObj <Product>(result, page, count, pageSize);

            return(View(pageObj));
        }
示例#3
0
        public ActionResult Product(int page = 1, int pageSize = 15)
        {
            var query = ProductManage.Instance.GetLambdaQuery();
            query.Where(b => b.SupplierId == CurrentUser.Id);

            var result = query.ToList();
            int count = query.RowCount;
            var pageObj = new PageObj<Product>(result, page, count, pageSize);
            return View(pageObj);
        }
示例#4
0
        public ActionResult Transaction(TransactionType type = TransactionType.现金, int page = 1, int pageSize = 15)
        {
            ViewBag.TransactionType = type;
            var query = BLL.Transaction.TransactionManage.Instance.GetLambdaQuery();
            var accountId = BLL.Transaction.AccountManage.Instance.GetAccountId(CurrentUser.Id, AccountType.会员, type);
            query.Where(b => b.AccountId == accountId);

            var result = query.ToList();
            int count = query.RowCount;
            var pageObj = new PageObj<CRL.Package.Account.Transaction>(result, page, count, pageSize);
            return View(pageObj);
        }
示例#5
0
        //
        // GET: /Proxy/

        public ActionResult Index(int page = 1, int pageSize = 100)
        {
            var query = BLL.ProxyPool.IpProxyManage.Instance.GetLambdaQuery();

            query.Page(pageSize, page);
            query.OrderBy(b => b.Id, true);
            var result  = query.ToList();
            int count   = query.RowCount;
            var pageObj = new PageObj <BLL.ProxyPool.IpProxy>(result, page, count, pageSize);

            return(View(pageObj));
        }
示例#6
0
        public ActionResult Product(int page = 1, int pageSize = 15)
        {
            var query = ProductManage.Instance.GetLambdaQuery();

            query.Where(b => b.SupplierId == CurrentUser.Id);

            var result  = query.ToList();
            int count   = query.RowCount;
            var pageObj = new PageObj <Product>(result, page, count, pageSize);

            return(View(pageObj));
        }
示例#7
0
        public ActionResult Transaction(TransactionType type = TransactionType.现金, int page = 1, int pageSize = 15)
        {
            ViewBag.TransactionType = type;
            var query     = BLL.Transaction.TransactionManage.Instance.GetLambdaQuery();
            var accountId = BLL.Transaction.AccountManage.Instance.GetAccountId(CurrentUser.Id, AccountType.会员, type);

            query.Where(b => b.AccountId == accountId);

            var result  = query.ToList();
            int count   = query.RowCount;
            var pageObj = new PageObj <CRL.Package.Account.Transaction>(result, page, count, pageSize);

            return(View(pageObj));
        }
示例#8
0
        public ActionResult Product(int page = 1, int pageSize = 15)
        {
            var sup = SupplierManage.Instance.GetCurrent();
            //var query = ProductManage.Instance.GetLambdaQuery().Where(b => b.SupplierId == sup.Id);
            var query = sup.Products.GetQuery();

            query.Page(pageSize, page);

            query.OrderBy(b => b.Id, false);
            var result  = query.ToList();
            int count   = query.RowCount;
            var pageObj = new PageObj <Product>(result, page, count, pageSize);

            return(View(pageObj));
        }
示例#9
0
        public ActionResult Index(string k, string c = "", int page = 1, int pageSize = 15)
        {
            int count;

            count = 0;
            var query = new CRL.ExpressionJoin<Product>(b => b.ProductStatus == CRL.Package.Product.ProductStatus.已上架);
            if (!string.IsNullOrEmpty(k))
            {
                query.And(b => b.ProductName.Contains(k));
            }
            if (!string.IsNullOrEmpty(c))
            {
                query.And(b => b.CategoryCode.StartsWith(c));
            }
            //使用缓存搜索
            IEnumerable<Product> products = BLL.ProductManage.Instance.QueryFromCache(query.GetExpression());
            products = products.OrderByDescending(b => b.Id);
            count = products.Count();
            var result = products.Skip((page - 1) * pageSize).Take(pageSize).ToList();
            var pageObj = new PageObj<Product>(result, page, count, pageSize);
            return View(pageObj);
        }
示例#10
0
 //
 // GET: /User/
 public ActionResult Index(string name,int role=0,int page=1)
 {
     int count;
     int pageSize = 15;
     var query = CRL.Package.RoleAuthorize.EmployeeBusiness.Instance.GetLambdaQuery();
     if (!string.IsNullOrEmpty(name))
     {
         query.Where(b => b.Name.Like("%" + name + "%"));
     }
     if (role > 0)
     {
         query.Where(b=>b.Role==role);
     }
     query.Page(pageSize, page);
     query.OrderBy(b => b.Id, true);
     //todo 分页
     var list = query.ToList();
     count = query.RowCount;
     var pageObj = new PageObj<CRL.Package.RoleAuthorize.Employee>(list, page, count, pageSize);
     var roles = CRL.Package.RoleAuthorize.RoleBusiness.Instance.QueryList();
     //var selectList = new SelectList(roles, "id", "Name", "24");
     ViewBag.Role = roles;
     return View(pageObj);
 }