示例#1
0
        public ActionResult List()
        {
            var    model      = new PostListModel();
            string keyword    = StringHelper.SqlEncode(PressRequest.GetQueryString("keyword"));
            int    categoryId = PressRequest.GetQueryInt("categoryid", -1);
            int    userId     = PressRequest.GetQueryInt("userid", -1);
            int    hide       = PressRequest.GetQueryInt("hide", -1);

            var catelist = _categoryService.GetCategoryList();

            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);
            int       cateid    = PressRequest.GetQueryInt("cateid", -1);
            int       tagid     = PressRequest.GetQueryInt("tagid", -1);

            catelist.Add(new CategoryInfo()
            {
                CateName = "全部", CategoryId = -1
            });
            model.CateSelectItem = catelist.ConvertAll(c => new SelectListItem {
                Text = c.CateName, Value = c.CategoryId.ToString(), Selected = c.CategoryId == cateid
            });

            if (cateid > 0)
            {
                pageIndex = pageIndex + 1;
            }
            var postlist = _postService.GetPostPageList(pageSize, pageIndex, out count, categoryId.ToString(), tagid, -1, -1, -1, -1, -1, "", "", keyword);

            model.PageList.LoadPagedList(postlist);
            model.PostList = (List <PostInfo>)postlist;
            return(View(model));
        }
示例#2
0
        public ActionResult Category(string pagename)
        {
            var          model = new PostListModel();
            CategoryInfo cate  = _categoryService.GetCategory(pagename);

            model.Category = cate;
            if (cate != null)
            {
                int categoryId = cate.CategoryId;
                model.MetaKeywords    = cate.CateName;
                model.MetaDescription = cate.Description;
                ViewBag.Title         = cate.CateName;
                model.Url             = ConfigHelper.SiteUrl + "category/" + Jqpress.Framework.Utils.StringHelper.SqlEncode(pagename) + "/page/{0}";

                const int pageSize  = 10;
                int       count     = 0;
                int       pageIndex = PressRequest.GetInt("page", 1);
                int       cateid    = PressRequest.GetQueryInt("cateid", -1);
                int       tagid     = PressRequest.GetQueryInt("tagid", -1);
                if (cateid > 0)
                {
                    pageIndex = pageIndex + 1;
                }
                var cateids  = categoryId + "," + _categoryService.GetCategoryList().FindAll(c => c.ParentId == categoryId).Aggregate(string.Empty, (current, t) => current + (t.CategoryId + ",")).TrimEnd(',');
                var postlist = _postService.GetPostPageList(pageSize, pageIndex, out count, cateids.TrimEnd(','), tagid, -1, -1, -1, -1, -1, "", "", "");
                model.PageList.LoadPagedList(postlist);
                model.PostList = (List <PostInfo>)postlist;
            }
            model.IsDefault = 0;


            return(View(model.Category.ViewName, model));
        }
示例#3
0
        public ActionResult ProjectVersionDownLoad(string id)
        {
            ProjectModel model     = new ProjectModel();
            const int    pageSize  = 10;
            int          count     = 0;
            int          pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            if (!string.IsNullOrEmpty(PressRequest.GetFormString("BeginDate")))
            {
                where += " and EndTime >= '" + PressRequest.GetFormString("BeginDate") + "' ";
            }
            if (!string.IsNullOrEmpty(PressRequest.GetFormString("EndDate")))
            {
                where += " and EndTime <= '" + PressRequest.GetFormString("EndDate") + "' ";
            }
            var list = _releaseService.GetReleaseListForDownLoad(id, pageSize, pageIndex, out count, where);

            model.Project     = _projectservice.GetById(id);
            model.ProjectList = _projectservice.GetProInfoList();
            model.PageList.LoadPagedList(list);
            model.ReleaseList = (List <CIRelease>)list;
            model.BeginDate   = PressRequest.GetFormString("BeginDate");
            model.EndDate     = PressRequest.GetFormString("EndDate");
            return(View(model));
        }
示例#4
0
        public ActionResult ProjectReleaseInfo(string id)
        {
            ProjectModel model = new ProjectModel();

            model.status      = Request["Status"];
            model.VersionType = Request["VersionType"];
            model.Teststatus  = Request["TestStatus"];
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            //版本类型
            if (model.VersionType == "1")
            {
                where += " and Type ='正式版本'";
            }
            else if (model.VersionType == "0")
            {
                where += " and Type ='测试版本'";
            }
            //发布状态
            if (model.status == "1")
            {
                where += " and Status ='发布成功'";
            }
            else if (model.status == "0")
            {
                where += " and Status ='发布失败'";
            }
            //测试状态
            if (model.Teststatus == "1")
            {
                where += " and TestStatus ='测试通过'";
            }
            else if (model.Teststatus == "0")
            {
                where += " and TestStatus ='不通过'";
            }
            if (!string.IsNullOrEmpty(PressRequest.GetFormString("BeginDate")))
            {
                where += " and AddTime >= '" + PressRequest.GetFormString("BeginDate") + "' ";
            }
            if (!string.IsNullOrEmpty(PressRequest.GetFormString("EndDate")))
            {
                where += " and AddTime <= '" + PressRequest.GetFormString("EndDate") + "' ";
            }
            var list = _releaseService.GetReleaseList(id, pageSize, pageIndex, out count, where);

            model.Project     = _projectservice.GetById(id);
            model.ProjectList = _projectservice.GetProInfoList();
            model.PageList.LoadPagedList(list);
            model.ReleaseList = (List <CIRelease>)list;
            model.BeginDate   = PressRequest.GetFormString("BeginDate");
            model.EndDate     = PressRequest.GetFormString("EndDate");
            return(View(model));
        }
示例#5
0
        public ActionResult List()
        {
            var       model     = new TagListModel();
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);
            var       list      = _tagService.GetTagListPage(pageSize, pageIndex, out count);

            model.PageList.LoadPagedList(list);
            model.TagList = (List <TagInfo>)list;
            return(View(model));
        }
示例#6
0
        /// <summary>
        /// 项目详情tab页评审列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult ProjectReviewInfo(string id, ProjectModel model)
        {
            //ProjectModel model = new ProjectModel();
            model.StatusSelectItem.Add(new SelectListItem {
                Text = "--选择状态--", Value = "", Selected = true
            });
            model.StatusSelectItem.Add(new SelectListItem {
                Text = "已评审", Value = "已评审"
            });
            model.StatusSelectItem.Add(new SelectListItem {
                Text = "未通过", Value = "未通过"
            });
            model.StatusSelectItem.Add(new SelectListItem {
                Text = "延期", Value = "延期"
            });
            model.StatusSelectItem.Add(new SelectListItem {
                Text = "不评审", Value = "不评审"
            });

            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            if (!string.IsNullOrEmpty(PressRequest.GetFormString("Status")))
            {
                where += " and r.Status ='" + PressRequest.GetFormString("Status") + "' ";
            }
            if (!string.IsNullOrEmpty(model.ProjectName) && Utils.IsSafeSqlString(model.ProjectName))
            {
                where += " and p.ProjectName like '%" + model.ProjectName + "%' ";
            }
            if (!string.IsNullOrEmpty(model.DemandCode) && Utils.IsSafeSqlString(model.DemandCode))
            {
                where += " and rp.DemandCode like '%" + model.DemandCode + "%' ";
            }
            if (!string.IsNullOrEmpty(model.BeginDate))
            {
                where += " and r.BeginDate >= '" + model.BeginDate + "' ";
            }
            if (!string.IsNullOrEmpty(model.EndDate))
            {
                where += " and r.BeginDate <= '" + model.EndDate + "' ";
            }

            var list = _reviewService.GetReviewListByProjectId(id, pageSize, pageIndex, out count, where);

            model.Project     = _projectservice.GetById(id);
            model.ProjectList = _projectservice.GetProInfoList();
            model.PageList.LoadPagedList(list);
            model.reviewlist = (List <CIReview>)list;
            return(View(model));
        }
示例#7
0
        /// <summary>
        /// 需求及缺陷列表
        /// </summary>
        /// <returns></returns>
        public ActionResult CheckList(CheckItemListModel model)
        {
            var planlist = new VersionPlanService().GetPlanList();

            model.PlanList       = planlist;
            model.PlanSelectItem = planlist.ConvertAll(c => new SelectListItem {
                Text = c.PlanCode, Value = c.ID
            });
            model.PlanSelectItem.Add(new SelectListItem {
                Text = "计划编号(全部)", Value = "", Selected = true
            });

            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            //如果角色为分组后的开发人员
            if (CurrentUser.Role != "管理员" && !String.IsNullOrEmpty(CurrentUser.OrgCode))
            {
                where += " and u.orgcode= '" + CurrentUser.OrgCode + "'";
            }
            //如果角色为没有分组后的开发人员
            if (CurrentUser.Role != "管理员" && String.IsNullOrEmpty(CurrentUser.OrgCode))
            {
                where += " and c.username= '******'";
            }
            //需求bug编号
            if (!string.IsNullOrEmpty(model.DemandCode) && Utils.IsSafeSqlString(model.DemandCode))
            {
                where += " and c.DemandCode like '%" + model.DemandCode + "%' ";
            }
            //时间选择
            if (!string.IsNullOrEmpty(model.datefrom))
            {
                where += " and c.updatetime>='" + model.datefrom + "' ";
            }
            if (!string.IsNullOrEmpty(model.dateto))
            {
                where += " and c.updatetime<='" + model.dateto + "' ";
            }
            //计划编号
            if (!string.IsNullOrEmpty(model.PlanId))
            {
                where += " and c.PlanId='" + model.PlanId + "'";
            }
            var list = _checkItemService.GetCheckItemPageList(pageSize, pageIndex, out count, where);

            model.PageList.LoadPagedList(list);
            model.ItemList = (List <CICheckItem>)list;
            return(View(model));
        }
示例#8
0
        //TODO:获取评论的文章地址需要优化

        public ActionResult List()
        {
            var       model     = new CommentModel();
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);
            int       approved  = PressRequest.GetQueryInt("approved", -1);

            var list = _commentService.GetCommentListPage(pageSize, pageIndex, out count, 1, -1, -1, -1, approved, -1, string.Empty);

            model.PageList.LoadPagedList(list);
            model.CommentList = (List <CommentInfo>)list;
            return(View(model));
        }
示例#9
0
        public ActionResult ReportList(ReportModel model)
        {
            const int pageSize  = 15;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            if (!string.IsNullOrEmpty(model.ReportName) && Utils.IsSafeSqlString(model.ReportName))
            {
                where = " and r.ReportName like '%" + model.ReportName + "%'";
            }
            var list = _reportService.GetReportList(pageSize, pageIndex, out count, where);

            model.Pagelist.LoadPagedList(list);
            model.ReportList = (List <CIReport>)list;
            return(View(model));
        }
示例#10
0
        /// <summary>
        /// 计划列表
        /// </summary>
        /// <returns></returns>
        public ActionResult List(PlanListModel model)
        {
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            if (!string.IsNullOrEmpty(model.PlanCode))
            {
                where += " and PlanCode like '%" + model.PlanCode + "%' ";
            }

            var list = _planService.GetPlanPageList(pageSize, pageIndex, out count, where);

            model.PageList.LoadPagedList(list);
            model.ItemList = (List <CIVersionPlan>)list;
            return(View(model));
        }
示例#11
0
        /// <summary>
        /// 标签
        /// </summary>
        public ActionResult Tag(string pagename)
        {
            var model = new PostListModel();

            model.SiteName        = SiteConfig.GetSetting().SiteName;
            model.ThemeName       = "printV1";
            model.PageTitle       = SiteConfig.GetSetting().SiteName;
            model.SiteUrl         = ConfigHelper.SiteUrl;
            model.MetaKeywords    = SiteConfig.GetSetting().MetaKeywords;
            model.MetaDescription = SiteConfig.GetSetting().MetaDescription;
            model.SiteDescription = SiteConfig.GetSetting().SiteDescription;
            model.NavLinks        = _linkService.GetLinkList((int)LinkPosition.Navigation, 1);
            model.RecentTags      = _tagService.GetTagList(SiteConfig.GetSetting().SidebarTagCount);
            model.FooterHtml      = SiteConfig.GetSetting().FooterHtml;
            model.GeneralLinks    = _linkService.GetLinkList((int)LinkPosition.General, 1);
            TagInfo tag = _tagService.GetTagByPageName(pagename);

            if (tag != null)
            {
                int tagId = tag.TagId;
                model.MetaKeywords    = tag.CateName;
                model.MetaDescription = tag.Description;
                model.PageTitle       = tag.CateName;
                model.PostMessage     = string.Format("<h2 class=\"post-message\">标签:{0}</h2>", tag.CateName);
                model.Url             = ConfigHelper.SiteUrl + "tag/" + Jqpress.Framework.Utils.StringHelper.SqlEncode(pagename) + "/page/{0}";
                const int pageSize  = 10;
                int       count     = 0;
                int       pageIndex = PressRequest.GetInt("page", 1);
                int       cateid    = PressRequest.GetQueryInt("cateid", -1);
                int       tagid     = PressRequest.GetQueryInt("tagid", -1);
                if (cateid > 0)
                {
                    pageIndex = pageIndex + 1;
                }
                var postlist = _postService.GetPostPageList(pageSize, pageIndex, out count, cateid.ToString(), tagId, -1, -1, -1, -1, -1, "", "", "");
                model.PageList.LoadPagedList(postlist);
                model.PostList = (List <PostInfo>)postlist;
            }
            model.IsDefault = 0;
            return(View("List", model));
        }
示例#12
0
        /// <summary>
        /// 项目列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult ProjectList(ProjectModel model)
        {
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = "";
            if (!string.IsNullOrEmpty(model.ProjectName) && Utils.IsSafeSqlString(model.ProjectName))
            {
                where += " and p.ProjectName like '%" + model.ProjectName + "%' ";
            }
            if (!string.IsNullOrEmpty(model.ProjectCode) && Utils.IsSafeSqlString(model.ProjectCode))
            {
                where += " and p.ProjectCode like '%" + model.ProjectCode + "%' ";
            }
            var list = _projectservice.GetProjectList(pageSize, pageIndex, out count, where);

            model.PageList.LoadPagedList(list);
            model.ProjectList = (List <CIProject>)list;
            return(View(model));
        }
示例#13
0
        public ActionResult ExportToExcel(CheckItemListModel model)
        {
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = GetWhere(model);

            var itemlist = _checkItemService.GetCheckItemPageList(pageSize, pageIndex, out count, where);

            var fitemlist = (List <CICheckItem>)itemlist;

            //代码重复
            if (model.CodeState == "1")
            {
                fitemlist = fitemlist.Where(i => i.CodeList.Contains("(重复)")).ToList();;
            }
            if (model.CodeState == "0")
            {
                fitemlist = fitemlist.Where(i => !i.CodeList.Contains("(重复)")).ToList();;
            }
            //是否新增代码
            if (model.IsNewCode == "1")
            {
                fitemlist = fitemlist.Where(i => i.CodeList.Contains("(新增)")).ToList();
            }
            if (model.IsNewCode == "0")
            {
                fitemlist = fitemlist.Where(i => !i.CodeList.Contains("(新增)")).ToList();
            }

            DataTable dt = new DataTable();

            ExcelHelper.ExportByWeb(ConvertToDatatable(fitemlist), "提交物清单:", "提交物清单" + string.Format("{0:yyyyMMddHHmmssffff}", DateTime.Now) + ".xls");



            SuccessNotification("导出excel成功");
            return(Redirect(Url.Action("deploylist", "checkitem")));
        }
示例#14
0
        /// <summary>
        /// get article
        /// </summary>
        /// <returns></returns>
        public ActionResult Edit()
        {
            int postid   = PressRequest.GetInt("id", 0);
            var model    = new PostModel();
            var catelist = _categoryService.GetCategoryTreeList();

            model.TagList = _tagService.GetTagList();

            if (postid > 0)
            {
                model.Post           = _postService.GetPost(postid);
                model.Post.Tag       = model.Post.Tags.Aggregate(string.Empty, (current, t) => current + (t.CateName + ",")).TrimEnd(',');
                model.CateSelectItem = catelist.ConvertAll(c => new SelectListItem {
                    Text = c.TreeChar + c.CateName, Value = c.CategoryId.ToString(), Selected = c.CategoryId == model.Post.CategoryId
                });
            }
            else
            {
                model.CateSelectItem = catelist.ConvertAll(c => new SelectListItem {
                    Text = c.TreeChar + c.CateName, Value = c.CategoryId.ToString()
                });
            }
            return(View(model));
        }
示例#15
0
        /// <summary>
        /// 发布列表
        /// </summary>
        /// <returns></returns>
        public ActionResult DeployList(CheckItemListModel model)
        {
            model.VersionState = Request["VersionState"];
            model.TestState    = Request["TestState"];
            model.CodeState    = Request["CodeState"];
            model.IsNewCode    = Request["IsNewCode"];
            const int pageSize  = 10;
            int       count     = 0;
            int       pageIndex = PressRequest.GetInt("page", 1);

            var where = GetWhere(model);

            var planlist = new VersionPlanService().GetPlanList();

            model.PlanSelectItem = planlist.ConvertAll(c => new SelectListItem {
                Text = c.PlanCode, Value = c.ID
            });
            model.PlanSelectItem.Add(new SelectListItem {
                Text = "计划编号(全部)", Value = "", Selected = true
            });

            var itemlist = _checkItemService.GetCheckItemPageList(pageSize, pageIndex, out count, where);

            //检查代码重复
            List <string> allcode = new List <string>(); //所有代码
            List <string> repcode = new List <string>(); //重复的代码

            foreach (var item in itemlist)
            {
                var      codelist = TypeConverter.ObjectToString(item.CodeList);
                var      codefile = codelist.Replace("(", "").Replace(")", "").Replace("(", "").Replace(")", "").Replace("新增", "").Replace("修改", "");
                string[] files    = codefile.Split('\n');
                foreach (var file in files)
                {
                    var vfile = file.Replace("\r", "").Replace(" ", "").Trim();
                    if (allcode.Contains(vfile))
                    {
                        repcode.Add(vfile);
                    }
                    allcode.Add(vfile);
                }
            }

            #region 判断当前页是否有重复代码
            var fitemlist = new List <CICheckItem>();

            /*foreach (var item in itemlist)
             * {
             *  foreach (var code in repcode)
             *  {
             *      if (item.CodeList != null)
             *      {
             *          if (item.CodeList.Contains(code))
             *          {
             *              if (code.IndexOf("重复") <= 0)
             *              {
             *                  item.CodeList = item.CodeList.Replace(code + "(", code + "(重复)(");
             *              }
             *          }
             *      }
             *  }
             *  fitemlist.Add(item);
             * }
             * //代码重复
             * if (model.CodeState == "1")
             * {
             *  fitemlist = fitemlist.Where(i => i.CodeList.Contains("(重复)")).ToList(); ;
             * }
             * if (model.CodeState == "0")
             * {
             *  fitemlist = fitemlist.Where(i => !i.CodeList.Contains("(重复)")).ToList(); ;
             * }*/
            #endregion

            //是否新增代码
            if (model.IsNewCode == "1")
            {
                fitemlist = fitemlist.Where(i => i.CodeList.Contains("(新增)")).ToList();
            }
            if (model.IsNewCode == "0")
            {
                fitemlist = fitemlist.Where(i => !i.CodeList.Contains("(新增)")).ToList();
            }

            model.PageList.LoadPagedList(itemlist);
            model.ItemList = itemlist.ToList();
            return(View(model));
        }