Exemple #1
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));
        }