Exemple #1
0
        public MODEL.ViewModel.EasyUIGrid GetaccountRecordGrid(MODEL.ViewModel.DataTableRequest request)
        {
            try
            {
                var predicate = PredicateBuilder.True <accountRecord>();

                DateTime time = TypeParser.ToDateTime("1975-1-1");

                int total = 0;
                predicate = predicate.And(p => p.typefund == 2);
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("published"))
                //{
                //    var i=TypeParser.ToInt32(FilterHelper.GetParaValue("published",request.Where,"&*&"));
                //    predicate = predicate.And(p1 => p1.ispublish == i);
                //}
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("check"))
                //{
                //    var i = TypeParser.ToInt32(FilterHelper.GetParaValue("check", request.Where, "&*&"));
                //    predicate = predicate.And(p2 => p2.ischeck == i);
                //}
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("searchmsg"))
                //{
                //    var i = FilterHelper.GetParaValue("searchmsg", request.Where, "&*&");
                //    predicate = predicate.And(p1 => p1.productname.Contains(i) || p1.keyword.Contains(i) || p1.supplier.suppliername.Contains(i) || p1.product_category.categoryname.Contains(i));
                //}
                //else if (!string.IsNullOrEmpty(request.Search))
                //{
                //    var i = request.Search;
                //    predicate = predicate.Or(p1 => p1.productname.Contains(i)|| p1.keyword.Contains(i) || p1.supplier.suppliername.Contains(i) || p1.product_category.categoryname.Contains(i));
                //}
                var data = base.LoadPagedList(request.PageNumber, request.PageSize, ref total, predicate, request.Model, p => true, request.SortOrder, request.SortName).Select(p => new ViewModelAccountRecord()
                {
                    id         = p.id,
                    aid        = p.aid,
                    typefund   = p.typefund,
                    money      = p.money,
                    membername = p.membername,
                    status     = p.status,
                    createdate = p.createdate,
                    finishdate = p.finishdate,
                    membercode = p.membercode,
                    payaddress = p.Member.payaddress,
                    paycode    = p.Member.paycode,
                    payname    = p.Member.payname,
                    paybank    = p.Member.paybank,
                    // paybao = p.Member.paybao
                });
                //var list = ViewModelProduct.ToListViewModel(data);
                return(new MODEL.ViewModel.EasyUIGrid()
                {
                    draw = request.Draw,
                    rows = data,
                    total = total
                });
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        public MODEL.ViewModel.EasyUIGrid GetProductGrid(MODEL.ViewModel.DataTableRequest request)
        {
            try
            {
                var predicate = PredicateBuilder.True <product>();

                DateTime time = TypeParser.ToDateTime("1975-1-1");

                int total = 0;
                predicate = predicate.And(p => p.isdelete != 1);
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("published"))
                //{
                //    var i=TypeParser.ToInt32(FilterHelper.GetParaValue("published",request.Where,"&*&"));
                //    predicate = predicate.And(p1 => p1.ispublish == i);
                //}
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("check"))
                //{
                //    var i = TypeParser.ToInt32(FilterHelper.GetParaValue("check", request.Where, "&*&"));
                //    predicate = predicate.And(p2 => p2.ischeck == i);
                //}
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("searchmsg"))
                //{
                //    var i = FilterHelper.GetParaValue("searchmsg", request.Where, "&*&");
                //    predicate = predicate.And(p1 => p1.productname.Contains(i) || p1.keyword.Contains(i) || p1.supplier.suppliername.Contains(i) || p1.product_category.categoryname.Contains(i));
                //}
                //else if (!string.IsNullOrEmpty(request.Search))
                //{
                //    var i = request.Search;
                //    predicate = predicate.Or(p1 => p1.productname.Contains(i)|| p1.keyword.Contains(i) || p1.supplier.suppliername.Contains(i) || p1.product_category.categoryname.Contains(i));
                //}
                var data = base.LoadPagedList(request.PageNumber, request.PageSize, ref total, predicate, request.Model, p => true, request.SortOrder, request.SortName).Select(p => new ViewModelProduct()
                {
                    Pid          = p.pid,
                    PcId         = p.pcid,
                    SupplierId   = p.supplierid.Value,
                    ProductName  = p.productname,
                    IsPublish    = p.ispublish.Value,
                    PublishDate  = p.publishdate == null ? time : p.publishdate.Value,
                    IsHot        = p.ishot.Value,
                    CreateDate   = p.createdate == null ? time : p.createdate,
                    IsCheck      = p.ischeck == null ? 0 : p.ischeck.Value,
                    Special      = p.isspecial == null ? 0 : p.isspecial.Value,
                    SupplierName = p.supplier.suppliername
                });
                //var list = ViewModelProduct.ToListViewModel(data);
                return(new MODEL.ViewModel.EasyUIGrid()
                {
                    draw = request.Draw,
                    rows = data,
                    total = total
                });
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #3
0
        public EasyUIGrid GetAllSuppliers(MODEL.ViewModel.DataTableRequest request)
        {
            int total = 0;

            return(new EasyUIGrid()
            {
                rows = GetAllSuppliers(request, ref total),
                total = total
            });
        }
        public MODEL.ViewModel.EasyUIGrid GetUpgradeRecordGrid(MODEL.ViewModel.DataTableRequest request)
        {
            try
            {
                var predicate = PredicateBuilder.True <UpgradeRecord>();

                DateTime time = TypeParser.ToDateTime("1975-1-1");

                int total = 0;
                predicate = predicate.And(p => p.isdelete != 1);
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("published"))
                //{
                //    var i=TypeParser.ToInt32(FilterHelper.GetParaValue("published",request.Where,"&*&"));
                //    predicate = predicate.And(p1 => p1.ispublish == i);
                //}
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("check"))
                //{
                //    var i = TypeParser.ToInt32(FilterHelper.GetParaValue("check", request.Where, "&*&"));
                //    predicate = predicate.And(p2 => p2.ischeck == i);
                //}
                //if (!string.IsNullOrEmpty(request.Where) && request.Where.Contains("searchmsg"))
                //{
                //    var i = FilterHelper.GetParaValue("searchmsg", request.Where, "&*&");
                //    predicate = predicate.And(p1 => p1.productname.Contains(i) || p1.keyword.Contains(i) || p1.supplier.suppliername.Contains(i) || p1.product_category.categoryname.Contains(i));
                //}
                //else if (!string.IsNullOrEmpty(request.Search))
                //{
                //    var i = request.Search;
                //    predicate = predicate.Or(p1 => p1.productname.Contains(i)|| p1.keyword.Contains(i) || p1.supplier.suppliername.Contains(i) || p1.product_category.categoryname.Contains(i));
                //}
                var data = base.LoadPagedList(request.PageNumber, request.PageSize, ref total, predicate, request.Model, p => true, request.SortOrder, request.SortName);
                //var list = ViewModelProduct.ToListViewModel(data);
                return(new MODEL.ViewModel.EasyUIGrid()
                {
                    draw = request.Draw,
                    rows = data,
                    total = total
                });
            }
            catch (Exception)
            {
                throw;
            }
        }