예제 #1
0
        public List <ArticleList> GetArticleList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("ArticleList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <ArticleList>());
            }

            List <ArticleList> article = (from l in dt.AsEnumerable()
                                          select new ArticleList
            {
                ID = l.Field <int>("ID"),
                ColumnName = l.Field <string>("ColumnName"),
                PageVisits = l.Field <int>("PageVisits"),
                UpdateTime = l.Field <DateTime>("UpdateTime"),
                UpdateUser = l.Field <string>("UpdateUser"),
                ShortTitle = l.Field <string>("ShortTitle"),
                SortOrder = l.Field <int>("SortOrder"),
                Title = l.Field <string>("Title")
            }).ToList();

            return(article.ToList());
        }
예제 #2
0
        public List <DocumentEntity> GetDocumentList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("DocumentsList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <DocumentEntity>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new DocumentEntity
            {
                Content = l.Field <string>("Content"),
                ID = l.Field <int>("ID"),
                MetaDescription = l.Field <string>("MetaDescription"),
                MetaKeywords = l.Field <string>("MetaKeywords"),
                Overview = l.Field <string>("Overview"),
                PageTitle = l.Field <string>("PageTitle"),
                PageVisits = l.Field <int?>("PageVisits"),
                Slug = l.Field <string>("Slug"),
                Title = l.Field <string>("Title"),
                UpdateUser = l.Field <int?>("UpdateUser"),
                DateCreated = l.Field <DateTime>("DateCreated"),
                UpdateUserName = l.Field <string>("UpdateUserName")
            }).ToList();

            return(article);
        }
예제 #3
0
파일: UserLogic.cs 프로젝트: yuabd/Hope
        public List <User> GetUserList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("UserList", param, XMLID.Admin, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <User>());
            }

            var list = (from l in dt.AsEnumerable()
                        select new User
            {
                ID = l.Field <int>("ID"),
                //Count = l.Field<int>("Count"),
                DateStart = l.Field <DateTime>("DateStart"),
                //DateEnd = l.Field<DateTime?>("DateEnd"),
                Description = l.Field <string>("Description"),
                Support = l.Field <int>("Support"),
                Phone = l.Field <string>("Phone"),
                HeadPicture = l.Field <string>("HeadPicture"),
                UserName = l.Field <string>("UserName"),
                LastLoginDate = l.Field <DateTime>("LastLoginDate"),
                Heart = l.Field <int>("Heart")
            }).ToList();

            return(list);
        }
예제 #4
0
        public List <ArticleList> GetHomeArticleList(int id)
        {
            GetReportDataParams param = new GetReportDataParams();

            param.Where.Add(new KeyValue()
            {
                Key = "ColumnID", Value = id.UString()
            });
            DataSet ds = MSSqlHelper.GetReportExportData("ArticleList", param.Where, param.Order);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <ArticleList>());
            }

            List <ArticleList> article = (from l in dt.AsEnumerable()
                                          select new ArticleList
            {
                ID = l.Field <int>("ID"),
                ColumnName = l.Field <string>("ColumnName"),
                PageVisits = l.Field <int>("PageVisits"),
                UpdateTime = l.Field <DateTime>("UpdateTime"),
                UpdateUser = l.Field <string>("UpdateUser"),
                ShortTitle = l.Field <string>("ShortTitle"),
                SortOrder = l.Field <int>("SortOrder"),
                Title = l.Field <string>("Title")
            }).ToList();

            return(article.ToList());
        }
예제 #5
0
 public List <LinksEntity> GetLinks(GetReportDataParams param, out int totalCount)
 {
     using (LinkLogic logic = new LinkLogic())
     {
         return(logic.GetLinks(param, out totalCount));
     }
 }
예제 #6
0
 public List <ContentTemplateEntity> GetContentTemplateList(GetReportDataParams param, out int totalCount)
 {
     using (ColumnLogic logic = new ColumnLogic(_db))
     {
         return(logic.GetContentTemplateList(param, out totalCount));
     }
 }
예제 #7
0
 public List <ArticleImageEntity> GetArticleImageList(GetReportDataParams param, out int totalCount)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetArticleImageList(param, out totalCount));
     }
 }
예제 #8
0
 public List <DocumentEntity> GetDocumentList(GetReportDataParams param, out int totalCount)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetDocumentList(param, out totalCount));
     }
 }
예제 #9
0
 public List <UserRoleEntity> GetUserRoleList(GetReportDataParams param, out int totalCount)
 {
     using (UserLogic logic = new UserLogic())
     {
         return(logic.GetUserRoleList(param, out totalCount));
     }
 }
예제 #10
0
파일: WishHelper.cs 프로젝트: yuabd/Hope
 public List <WishList> GetWishReport(GetReportDataParams param, out int totalCount)
 {
     using (WishLogic logic = new WishLogic(db))
     {
         return(logic.GetWishReport(param, out totalCount));
     }
 }
예제 #11
0
        public List <ColumnList> GetColumnList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("ColumnList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <ColumnList>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new ColumnList
            {
                ColumuName = l.Field <string>("ColumnName"),
                ID = l.Field <int>("ID"),
                IsPublic = l.Field <string>("IsPublic"),
                AdminListUrl = l.Field <string>("AdminListUrl"),
                ContentTemplateID = l.Field <int>("ContentTemplateID"),
                ParentID = l.Field <int?>("ParentID"),
                SortOrder = l.Field <int>("SortOrder"),
                UpdateDate = l.Field <DateTime>("UpdateDate"),
                UpdateUser = l.Field <string>("UserName"),
            }).ToList();

            return(article);
        }
예제 #12
0
 public List <News> GetNewsList(GetReportDataParams param, out int totalCount)
 {
     using (NewsLogic logic = new NewsLogic())
     {
         return(logic.GetNewsList(param, out totalCount));
     }
 }
예제 #13
0
파일: WishLogic.cs 프로젝트: yuabd/Hope
        public List <WishList> GetWishReport(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("WishList", param, XMLID.Admin, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <WishList>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new WishList
            {
                ID = l.Field <int>("ID"),
                Count = l.Field <int>("Count"),
                DateStart = l.Field <DateTime?>("DateStart"),
                Name = l.Field <string>("Name"),
                Title = l.Field <string>("Title"),
                Support = l.Field <int>("Support"),
                StatusID = l.Field <int>("Status"),
                UserName = l.Field <string>("AddUser"),
                ApplyUser = l.Field <string>("ApplyUser"),
                UserID = l.Field <int>("UserID"),
                ApplyUserID = l.Field <int>("ApplyUserID"),
                PictureFile = l.Field <string>("PictureFile"),
            }).ToList();

            article.ForEach(m => m.Status = GetStatusName(m.StatusID));

            return(article);
        }
예제 #14
0
 /// <summary>
 /// 课程列表
 /// </summary>
 /// <param name="param"></param>
 /// <param name="totalCount"></param>
 /// <returns></returns>
 public List <CourseEntity> GetCourseReport(GetReportDataParams param, out int totalCount)
 {
     using (CourseLogic logic = new CourseLogic())
     {
         return(logic.GetCourseReport(param, out totalCount));
     }
 }
예제 #15
0
 public List <IndustryEntity> GetIndustryListReport(GetReportDataParams param, out int totalCount)
 {
     using (IndustryLogic logic = new IndustryLogic())
     {
         return(logic.GetIndustryListReport(param, out totalCount));
     }
 }
예제 #16
0
        /// <summary>
        /// 课程列表
        /// </summary>
        /// <param name="param"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public List <CourseEntity> GetCourseReport(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("CourseList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <CourseEntity>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new CourseEntity
            {
                ID = l.Field <int>("ID"),
                AddUserName = l.Field <string>("UserName"),
                Contact = l.Field <string>("Contact"),
                AddDate = l.Field <DateTime>("AddDate"),
                StartDate = l.Field <DateTime?>("StartDate"),
                CourseName = l.Field <string>("CourseName"),
                Industry = l.Field <string>("Industry"),
                CourseType = l.Field <string>("CourseType"),
                ApplyCount = l.Field <int?>("ApplyCount"),
                State = l.Field <int>("State")
            }).ToList();

            return(article);
        }
예제 #17
0
        /// <summary>
        /// 前??台???需??要?a点??击??排?序??的??时???候??调???用??
        /// </summary>
        /// <param name="reportName"> XML对?应?|的??名?称? </param>
        /// <param name="where"> 查??询??条??件t </param>
        /// <param name="pageSize"> 页?3面?打???小? </param>
        /// <param name="pageIndex"> 页?3面?索??引?y </param>
        /// <param name="order"></param>
        /// <param name="systemID"> 系??统?3ID</param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public static DataSet GetReportData(string reportName, GetReportDataParams param,
                                            int systemID, ReportConnectionType type, out int totalCount, bool optimize = false)
        {
            if (param.Where != null)
            {
                foreach (var item in param.Where)
                {
                    item.Value = item.Value.Trim();
                }
            }
            DataSet ds;

            //switch (ConfigContext.SqlAss)
            //{
            //    case SqlEnum.MSSql:
            //        ds = MSSqlHelper.GetReportData(reportName, param, systemID, type, out totalCount);
            //        break;
            //    case SqlEnum.MYSql:
            //        ds = MySqlHelper.GetReportData(reportName, param, systemID, type, out totalCount, optimize);
            //        if (ds.Tables[0].Columns.Cast<DataColumn>().Where(q => q.DataType == typeof(Int64)).Count() == 0)
            //        {
            //            break;
            //        }
            //        DataSet resDs = new DataSet();
            //        resDs.Tables.Add(ds.Tables[0].Clone());
            //        resDs.Tables[0].Columns.Cast<DataColumn>().Where(q => q.DataType == typeof(Int64)).ToList().ForEach(q => q.DataType = typeof(int));
            //        foreach (var item in ds.Tables[0].Rows)
            //        {
            //            resDs.Tables[0].ImportRow(item as DataRow);
            //        }
            //        ds = resDs;
            //        break;
            //    default:
            //        ds = MSSqlHelper.GetReportData(reportName, param, systemID, type, out totalCount);
            //        break;
            //}
            ds = MySqlHelper.GetReportData(reportName, param, systemID, type, out totalCount, optimize);
            if (ds.Tables[0].Columns.Cast <DataColumn>().Where(q => q.DataType == typeof(Int64)).Count() == 0)
            {
                return(ds);
            }
            DataSet resDs = new DataSet();

            resDs.Tables.Add(ds.Tables[0].Clone());
            resDs.Tables[0].Columns.Cast <DataColumn>().Where(q => q.DataType == typeof(Int64)).ToList().ForEach(q => q.DataType = typeof(int));
            foreach (var item in ds.Tables[0].Rows)
            {
                resDs.Tables[0].ImportRow(item as DataRow);
            }
            ds = resDs;

            return(ds);
        }
예제 #18
0
        public List <UserRoleEntity> GetUserRoleList(GetReportDataParams param, out int totalCount)
        {
            var list = (from l in _db.UserRoles
                        select new UserRoleEntity
            {
                ID = l.ID,
                RoleName = l.RoleName
            }).ToList();

            totalCount = list.Count;

            return(list);
        }
예제 #19
0
        //支援者
        public ActionResult WeakerList(string name, int?page)
        {
            int tCount = 0;
            GetReportDataParams param = new GetReportDataParams();

            List <KeyValue> where = new Functions().GetParam(Request);

            if (!string.IsNullOrEmpty(name))
            {
                where.Add(new KeyValue {
                    Key = "UserName", Value = name.UString()
                });
            }

            param.PageIndex = string.IsNullOrEmpty(Request["page"]) ? 1 : Convert.ToInt32(Request["page"]);
            param.PageSize  = string.IsNullOrEmpty(Request["rows"]) ? 20 : Convert.ToInt32(Request["rows"]);
            param.Order     = Request["sort"] == null ? "" : Request["sort"] + " " + Request["order"];
            param.Where     = where;
            if (Request["sort"] != null)
            {
                var request = Request["sort"].UString();
                if (request.Contains("Heart"))
                {
                    ViewBag.Heart = "current";
                }
                else if (request.Contains("Support"))
                {
                    ViewBag.Support = "current";
                }
                else
                {
                    ViewBag.All = "current";
                }
            }
            else
            {
                ViewBag.All = "current";
            }

            ViewBag.Weaker = "current";

            var list  = new UserHelper().GetUserList(param, out tCount);
            var model = new SitePaginated <User>(list, page ?? 1, 20);

            return(View(model));
        }
예제 #20
0
        public ActionResult AlreadyApplyWishJson()
        {
            int tCount = 0;
            GetReportDataParams param = new GetReportDataParams();

            List <KeyValue> where = new Functions().GetParam(Request);

            param.PageIndex = string.IsNullOrEmpty(Request["page"]) ? 1 : Convert.ToInt32(Request["page"]);
            param.PageSize  = string.IsNullOrEmpty(Request["rows"]) ? 20 : Convert.ToInt32(Request["rows"]);
            param.Order     = Request["sort"] == null ? "" : Request["sort"] + " " + Request["order"];
            param.Where     = where;

            var list = new WishHelper().GetWishReport(param, out tCount);
            var json = new DataGridJson(tCount, list);

            return(Json(json));
        }
예제 #21
0
        public ActionResult ColumnListJson()
        {
            int tCount = 0;
            GetReportDataParams param = new GetReportDataParams();

            List <KeyValue> where = new Functions().GetParam(Request);
            //where.Add(new KeyValue() { Key = "ChlBusinessID", Value = new UserHelper().CurrentChlBussinessID.ToString() });

            param.PageIndex = string.IsNullOrEmpty(Request["page"]) ? 1 : Convert.ToInt32(Request["page"]);
            param.PageSize  = string.IsNullOrEmpty(Request["rows"]) ? 20 : Convert.ToInt32(Request["rows"]);
            param.Order     = Request["sort"] == null ? "" : Request["sort"] + " " + Request["order"];
            param.Where     = where;

            var list = new Helpers.SystemHelper().GetColumnList(param, out tCount);
            var json = new DataGridJson(tCount, list);

            return(Json(json));
        }
예제 #22
0
파일: LinkLogic.cs 프로젝트: yuabd/Service
        public List <LinksEntity> GetLinks(GetReportDataParams param, out int totalCount)
        {
            var list = (from l in _db.Links
                        join m in _db.LinkCategories on l.LinkCategoryID equals m.ID
                        select new LinksEntity()
            {
                Contact = l.Contact,
                Description = l.Description,
                Email = l.Email,
                ID = l.ID,
                LinkCategory = m.Name,
                Name = l.Name,
                LinkUrl = l.LinkUrl,
                PictureFile = l.PictureFile,
                SortOrder = l.SortOrder,
                DateCreated = l.DateCreated,
                UpdateUser = l.UpdateUser
            }).ToList();

            #region 查询条件

            list = param.Where.Where(m => m.Key.ToLower() == "name")
                   .Aggregate(list,
                              (current, column) =>
                              (from l in current where l.Name.Contains(column.Value) select l).ToList());

            list = param.Where.Where(m => m.Key.ToLower() == "startdate")
                   .Aggregate(list,
                              (current, column) =>
                              (from l in current where l.DateCreated >= Convert.ToDateTime(column.Value) select l).ToList());

            list = param.Where.Where(m => m.Key.ToLower() == "enddate")
                   .Aggregate(list,
                              (current, column) =>
                              (from l in current where l.DateCreated <= Convert.ToDateTime(column.Value) select l).ToList());

            #endregion


            totalCount = list.Count();

            return(list.ToList());
        }
예제 #23
0
        public ActionResult NewsListJson()
        {
            int tCount = 0;
            GetReportDataParams param = new GetReportDataParams();

            List <KeyValue> where = new Functions().GetParam(Request);
            where.Add(new KeyValue {
                Key = "CategoryID", Value = "1"
            });

            param.PageIndex = string.IsNullOrEmpty(Request["page"]) ? 1 : Convert.ToInt32(Request["page"]);
            param.PageSize  = string.IsNullOrEmpty(Request["rows"]) ? 20 : Convert.ToInt32(Request["rows"]);
            param.Order     = Request["sort"] == null ? "" : Request["sort"] + " " + Request["order"];
            param.Where     = where;

            var list = new NewsHelper().GetNewsList(param, out tCount);
            var json = new DataGridJson(tCount, list);

            return(Json(json));
        }
예제 #24
0
        public ActionResult WishListJson()
        {
            int tCount = 0;
            GetReportDataParams param = new GetReportDataParams();

            List <KeyValue> where = new Functions().GetParam(Request);
            //where.Add(new KeyValue { Key = "Status1", Value = WishStatus.WaitAudit.ToString() });
            where.Add(new KeyValue {
                Key = "UserID", Value = User.Identity.Name
            });

            param.PageIndex = string.IsNullOrEmpty(Request["page"]) ? 1 : Convert.ToInt32(Request["page"]);
            param.PageSize  = string.IsNullOrEmpty(Request["rows"]) ? 20 : Convert.ToInt32(Request["rows"]);
            param.Order     = Request["sort"] == null ? "" : Request["sort"] + " " + Request["order"];
            param.Where     = where;

            var list = new WishHelper().GetWishReport(param, out tCount);
            var json = new DataGridJson(tCount, list);

            return(Json(json));
        }
예제 #25
0
        public List <UserEntity> GetUserListReport(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("UserList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <UserEntity>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new UserEntity
            {
                ID = l.Field <int>("ID"),
                DateCreated = l.Field <DateTime>("DateCreated"),
                DateLastLogin = l.Field <DateTime>("DateLastLogin"),
                IsActive = l.Field <string>("IsActive"),
                UserName = l.Field <string>("UserName")
            }).ToList();

            return(article);
        }
예제 #26
0
        public List <ArticleImageEntity> GetArticleImageList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("ArticleImageList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <ArticleImageEntity>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new ArticleImageEntity
            {
                Author = l.Field <string>("Author"),
                UpdateUser = l.Field <string>("UserName"),
                Title = l.Field <string>("Title"),
                Source = l.Field <string>("Source"),
                SortOrder = l.Field <int>("SortOrder"),
                Slug = l.Field <string>("Slug"),
                ShortTitle = l.Field <string>("ShortTitle"),
                PageVisits = l.Field <int>("PageVisits"),
                PageTitle = l.Field <string>("PageTitle"),
                MetaKeywords = l.Field <string>("MetaKeywords"),
                MetaDescription = l.Field <string>("MetaDescription"),
                DateCreated = l.Field <DateTime>("DateCreated"),
                //Content = l.Field<string>("Content"),
                //IsDelete = l.IsDelete,
                Overview = l.Field <string>("Overview"),
                Photo = l.Field <string>("Photo"),
                ColumnID = l.Field <int>("ColumnID"),
                ID = l.Field <int>("ID")
            }).ToList();

            //article.ForEach(m => m.Photo =
            //    _db.Pictures.Where(l => l.TargetID == m.ID && l.Type == PictureType.ArticleImage
            //        && l.IsDefault == PublicType.Yes).Select(n => n.PictureUrl).FirstOrDefault());

            return(article.ToList());
        }
예제 #27
0
        //
        // GET: /News/

        public ActionResult Index(int?page)
        {
            int tCount = 0;
            GetReportDataParams param = new GetReportDataParams();

            List <KeyValue> where = new Functions().GetParam(Request);
            where.Add(new KeyValue {
                Key = "CategoryID", Value = "1"
            });

            param.PageIndex = string.IsNullOrEmpty(Request["page"]) ? 1 : Convert.ToInt32(Request["page"]);
            param.PageSize  = string.IsNullOrEmpty(Request["rows"]) ? 20 : Convert.ToInt32(Request["rows"]);
            param.Order     = Request["sort"] == null ? "" : Request["sort"] + " " + Request["order"];
            param.Where     = where;

            var list  = new NewsHelper().GetNewsList(param, out tCount);
            var model = new SitePaginated <News>(list, page ?? 1, 20);

            ViewBag.News = "current";

            return(View(model));
        }
예제 #28
0
        public List <IndustryEntity> GetIndustryListReport(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("IndustryList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <IndustryEntity>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new IndustryEntity
            {
                ID = l.Field <int>("ID"),
                AddDate = l.Field <DateTime>("AddDate"),
                UserID = l.Field <int?>("UserID"),
                UserName = l.Field <string>("UserName"),
                IndustryName = l.Field <string>("IndustryName"),
                Description = l.Field <string>("Description")
            }).ToList();

            return(article.ToList());
        }
예제 #29
0
        public List <News> GetNewsList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("NewsList", param, XMLID.Admin, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <News>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new News
            {
                ID = l.Field <int>("ID"),
                Count = l.Field <int>("Count"),
                Title = l.Field <string>("Title"),
                Content = l.Field <string>("Content"),
                SortOrder = l.Field <int>("SortOrder"),
                DateCreated = l.Field <DateTime>("DateCreated")
            }).ToList();

            return(article);
        }
예제 #30
0
        public List <SidebarEntity> GetSidebarList(GetReportDataParams param, out int totalCount)
        {
            DataSet ds = MSSqlHelper.GetReportData("SidebarList", param, out totalCount);
            var     dt = ds.Tables[0];

            if (dt == null)
            {
                return(new List <SidebarEntity>());
            }

            var article = (from l in dt.AsEnumerable()
                           select new SidebarEntity
            {
                UpdateUser = l.Field <string>("UpdateUser"),
                Title = l.Field <string>("Title"),
                Type = l.Field <string>("Type"),
                UpdateDate = l.Field <DateTime>("UpdateDate"),
                ColumnID = l.Field <int>("ColumnID"),
                ID = l.Field <int>("ID")
            }).ToList();

            return(article.ToList());
        }