Пример #1
0
        public List <DocumentItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.Documents
                        orderby c.ID descending
                        select new DocumentItem
            {
                ID          = c.ID,
                Name        = c.Name,
                Description = c.Description,
                CreatedDate = c.CreatedDate,
                IsShow      = c.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #2
0
        public List <StackItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int Agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.DN_Stack
                        where o.AgencyID == Agencyid
                        orderby o.ID descending
                        select new StackItem
            {
                ID = o.ID,

                Date = o.Date,
                Json = o.Json,
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #3
0
        public List <LevelVoteItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.LevelVotes
                        orderby o.ID descending
                        select new LevelVoteItem
            {
                ID       = o.ID,
                Name     = o.Name,
                Soft     = o.Soft,
                Value    = o.Value,
                AgencyID = o.AgencyID
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #4
0
 public List<PacketItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
 {
     Request = new ParramRequest(httpRequest);
     var query = from c in FDIDB.DN_Packet
                 where c.AgencyID == agencyid
                 orderby c.ID descending
                 select new PacketItem
                 {
                     ID = c.ID,
                     Name = c.Name.Trim(),
                     Sort = c.Sort,
                     Time = c.Time,
                     Price = c.Price,
                 };
     query = query.SelectByRequest(Request, ref TotalRecord);
     return query.ToList();
 }
Пример #5
0
        public List <EnterprisesItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            var date = DateTime.Now.TotalSeconds();

            Request = new ParramRequest(httpRequest);
            var status = httpRequest["isstatus"];
            var query  = from o in FDIDB.DN_Enterprises
                         where !o.IsDeleted.HasValue || o.IsDeleted == false
                         orderby o.ID descending
                         select new EnterprisesItem
            {
                ID       = o.ID,
                Name     = o.Name.Trim(),
                Email    = o.Email,
                Address  = o.Address,
                Phone    = o.Phone,
                CMTND    = o.CMTND,
                IsLocked = o.IsLocked,
                UserName = o.UserName,
                IsTest   = o.IsTest,
                Url      = o.Url,
                TotalPay = o.DN_Agency.Sum(m => m.Customer_Reward.Sum(c => c.PriceReward - c.PriceReceive)),
                DateEnd  = o.DateEnd,
                DomainDN = o.DomainDN,
                Percent  = o.Percent
            };

            if (!string.IsNullOrEmpty(status))
            {
                if (status == "1")
                {
                    query = query.Where(m => m.DateEnd > date && (!m.IsTest.HasValue || m.IsTest.Value));
                }
                if (status == "2")
                {
                    query = query.Where(m => m.DateEnd < date);
                }
                if (status == "3")
                {
                    query = query.Where(m => m.IsTest == true);
                }
            }
            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #6
0
        public List <DNDocumentRoomItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.DN_DocumentRoom
                        where c.AgencyID == agencyid
                        orderby c.ID descending
                        select new DNDocumentRoomItem
            {
                ID                = c.ID,
                Name              = c.Name.Trim(),
                Sort              = c.Sort,
                DocumentLevelID   = c.DocumentLevelID,
                DocumentLevelName = c.DN_DocumentLevel.Name
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #7
0
        public List <DNRolesItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.DN_Roles
                        where c.AgencyID == agencyid && (!c.IsDeleted.HasValue || c.IsDeleted == false)
                        orderby c.RoleName descending
                        select new DNRolesItem
            {
                RoleId          = c.RoleId,
                RoleName        = c.RoleName,
                Description     = c.Description,
                LoweredRoleName = c.DN_Level.Name,
                ListModuleID    = c.DN_Module.Where(v => v.IsDelete == false && v.IsShow == true).Select(v => v.ID)
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #8
0
        public List <DistrictItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.System_District
                        orderby o.Name
                        select new DistrictItem
            {
                ID          = o.ID,
                Name        = o.Name.Trim(),
                Show        = o.Show,
                Description = o.Description,
                CityName    = o.System_City.Name.Trim(),
                CityID      = o.System_City.ID
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #9
0
        public List <CountryItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.System_Country
                        orderby o.Name
                        where o.IsDelete == false
                        select new CountryItem
            {
                ID          = o.ID,
                Code        = o.Code,
                Name        = o.Name,
                Show        = o.Show,
                Description = o.Description
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #10
0
        public List <CateValueItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int Agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.Cate_Value
                        where o.IsDelete == false && o.AgencyId == Agencyid
                        orderby o.ID descending
                        select new CateValueItem
            {
                ID = o.ID,
                //Name = o.Name.Trim(),
                //Date = o.Date,
                //Quantity = o.Quantity,
                //IsShow = o.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #11
0
        public List <SystemConfigItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.System_Config
                        orderby o.ID descending
                        where o.LanguageId == LanguageId
                        select new SystemConfigItem
            {
                ID      = o.ID,
                Name    = o.Name.Trim(),
                IsShow  = o.IsShow,
                Email   = o.Email,
                Address = o.Address
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #12
0
        public List <DNNewsCommentItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.DN_News_Comment
                        where o.IsShow == true
                        orderby o.ID descending
                        select new DNNewsCommentItem
            {
                ID          = o.ID,
                Message     = o.Message.Trim(),
                UserId      = o.UserId,
                DateCreated = o.DateCreated,
                IsShow      = o.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #13
0
        public List <LogItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.Logs
                        orderby o.ID descending
                        select new LogItem
            {
                ID       = o.ID,
                User     = o.User,
                ChucNang = o.ChucNang,
                NgayTao  = o.NgayTao,
                CuaHang  = o.CuaHang,
                NoiDung  = o.NoiDung
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #14
0
        public List <ColorItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyId)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.System_Color
                        orderby o.ID
                        select new ColorItem
            {
                ID          = o.ID,
                Name        = o.Name,
                Value       = o.Value,
                IsShow      = o.IsShow,
                Description = o.Description,
                LanguageId  = o.LanguageId
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #15
0
        public List <LanguagesItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.Languages
                        orderby o.Name
                        select new LanguagesItem
            {
                ID              = o.Id,
                Name            = o.Name.Trim(),
                Code            = o.Code,
                FallbackCulture = o.FallbackCulture,
                CreatedDate     = o.CreatedDate,
                IsShow          = o.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #16
0
        public List <CustomerRewardItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyId)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.Customer_Reward
                        where c.AgencyID == agencyId
                        orderby c.PriceReward descending
                        select new CustomerRewardItem
            {
                ID           = c.ID,
                CustomerName = c.Customer.FullName,
                CustomerID   = c.CustomerID,
                PriceReward  = c.PriceReward,
                PriceReceive = c.PriceReceive
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #17
0
        public List <DNDocumentLevelItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.DN_DocumentLevel
                        where c.AgencyId == agencyid && c.IsDeleted == false
                        orderby c.ID descending
                        select new DNDocumentLevelItem
            {
                ID        = c.ID,
                Name      = c.Name,
                NameLevel = c.NameLevel + c.Name,
                Sort      = c.Sort,
                IsShow    = c.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #18
0
        public List <ModuleItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.Modules
                        select new ModuleItem
            {
                ID         = c.ID,
                NameModule = c.NameModule,
                Tag        = c.Tag,
                Ord        = c.Ord,
                PrarentID  = c.PrarentID.Value,
                Content    = c.Content,
                IsShow     = c.IsShow != null && c.IsShow.Value
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #19
0
        public List <DayOffItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int Agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.DN_DayOff
                        where o.IsDelete == false && o.AgencyID == Agencyid
                        orderby o.ID descending
                        select new DayOffItem
            {
                ID       = o.ID,
                Name     = o.Name.Trim(),
                Date     = o.Date,
                Quantity = o.Quantity,
                IsShow   = o.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #20
0
        public List <OrderDebtItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int Agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.Order_Debt
                        orderby o.ID descending
                        select new OrderDebtItem
            {
                ID         = o.ID,
                Pricetotal = o.Pricetotal,
                Note       = o.Note,
                UserName   = o.DN_Users.UserName,
                Datecreate = o.Datecreate,
                //SupplieName = o.DN_Supplie.Name
                //DateImport = o.Supplier_Product.Select(m=>m.DateCreated).FirstOrDefault()
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #21
0
        /// <summary>
        /// Lấy về kiểu đơn giản, phân trang
        /// </summary>
        /// <param name="httpRequest"> </param>
        /// <returns>Danh sách bản ghi</returns>
        public List <FileItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.System_File
                        select new FileItem
            {
                ID        = o.ID,
                Name      = o.Name,
                Data      = o.Data,
                TypeName  = o.System_FileType.Name,
                TypeIcon  = o.System_FileType.Icon,
                TotalNews = o.News_News.Count(),
                //TotalProduct = o.Shop_Product.Count(),
                TotalAnswer = o.FAQ_Answer.Count()
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #22
0
        public List <DNComboItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.DN_Combo
                        where o.AgencyId == agencyid && o.IsDeleted == false
                        orderby o.ID descending
                        select new DNComboItem
            {
                ID        = o.ID,
                Name      = o.Name.Trim(),
                Price     = o.Price,
                DateEnd   = o.DateEnd,
                DateStart = o.DateStart,
                Percent   = o.Price
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #23
0
        public List <NewsItem> SearchNewsByConditions(HttpRequestBase httpRequest, List <int> caInts)
        {
            Request = new ParramRequest(httpRequest);

            var query = from c in FDIDB.News_News
                        where c.Categories.Any(m => caInts.Contains(m.Id)) && c.IsDeleted == false
                        orderby c.ID
                        select new NewsItem
            {
                ID         = c.ID,
                Title      = c.Title,
                TitleAscii = c.TitleAscii,
                IsShow     = c.IsShow,
                IsHot      = c.IsHot
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #24
0
        public List <CustomerGroupItem> GetListRequest(HttpRequestBase httpRequest, int agencyId)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.Customer_Groups
                        where c.IsDelete == false && c.AgencyId == agencyId
                        orderby c.ID descending
                        select new CustomerGroupItem
            {
                ID          = c.ID,
                Name        = c.Name,
                Description = c.Description,
                Discount    = c.Discount,
                TotalPrice  = c.TotalPrice,
                Level       = c.Level
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #25
0
        public List <BiasProduceItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.BiasProduces
                        where c.AgencyID == agencyid && c.IsDeleted == false
                        orderby c.ID descending
                        select new BiasProduceItem
            {
                ID          = c.ID,
                Name        = c.Name,
                EndDate     = c.EndDate,
                StartDate   = c.StartDate,
                Quantity    = c.Quantity,
                ProductName = c.Shop_Product.Shop_Product_Detail.Name
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #26
0
        /// <summary>
        /// Lấy về kiểu đơn giản, phân trang
        /// </summary>
        /// <param name="httpRequest"> </param>
        /// <returns>Danh sách bản ghi</returns>
        public List <VoteTypeItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.Vote_Type
                        where c.LanguageId == LanguageId && c.IsShow == true
                        select new VoteTypeItem
            {
                Id          = c.ID,
                Title       = c.Title,
                Description = c.Description,
                Sort        = c.Sort,
                Type        = c.Type,
                IsHome      = c.IsHome,
                IsShow      = c.IsShow,
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #27
0
        public List <DNCriteriaItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.DN_Criteria
                        where o.AgencyID == agencyid
                        orderby o.ID descending
                        select new DNCriteriaItem
            {
                ID         = o.ID,
                Name       = o.Name.Trim(),
                NameType   = o.DN_TypeCriteria.Name,
                Price      = o.Price,
                IsAll      = o.IsAll,
                IsSchedule = o.IsSchedule,
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #28
0
        public List <DNFileMailItem> GetListSimpleByRequest(HttpRequestBase httpRequest, int agencyId)
        {
            Request = new ParramRequest(httpRequest);
            var query = from o in FDIDB.DN_File_Mail
                        where o.IsDeleted == false && o.AgencyId == agencyId
                        orderby o.ID descending
                        select new DNFileMailItem
            {
                ID          = o.ID,
                Name        = o.Name.Trim(),
                Url         = o.Url,
                DateCreated = o.DateCreated,
                Folder      = o.Folder,
                IsShow      = o.IsShow
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }
Пример #29
0
        /// <summary>
        /// Tổng quát ứng
        /// </summary>
        /// <param name="httpRequest"></param>
        /// <param name="agencyid"></param>
        /// <returns></returns>
        public List <CashAdvanceItem> GetListGeneralCash(HttpRequestBase httpRequest, int agencyid)
        {
            Request = new ParramRequest(httpRequest);

            var query = from c in FDIDB.DN_Users
                        where c.AgencyID == agencyid &&
                        (c.CashAdvances1.Any(v => v.IsActive == true) || c.Repays1.Any(v => v.IsActive == true)) && (!c.IsDeleted.HasValue || c.IsDeleted == false)
                        orderby c.UserName
                        select new CashAdvanceItem
            {
                Name       = c.LoweredUserName,
                UserName   = c.UserName,
                TotalCash  = c.CashAdvances1.Where(v => v.IsActive == true).Sum(v => v.Price),
                TotalRepay = c.Repays1.Where(v => v.IsActive == true).Sum(v => v.Price),
            };

            query = query.SelectByRequest(Request);
            return(query.ToList());
        }
Пример #30
0
        public List <DNDrawerItem> GetListSimpleByRequest(HttpRequestBase httpRequest)
        {
            Request = new ParramRequest(httpRequest);
            var query = from c in FDIDB.DN_Drawer
                        where  c.IsDelete == false
                        orderby c.ID descending
                        select new DNDrawerItem
            {
                ID                = c.ID,
                Name              = c.Name.Trim(),
                Description       = c.Description,
                CabinetDocumentID = c.CabinetDocumentID,
                IsShow            = c.IsShow,
                Sort              = c.Sort
            };

            query = query.SelectByRequest(Request, ref TotalRecord);
            return(query.ToList());
        }