示例#1
0
        ///<summary>
        ///控制评分时间配置新建/修改
        ///</summary>
        /// <param name="ReviewMatterID">控制评分时间ID</param>
        /// <returns>实体</returns>
        public ActionResult ControlJudgeTimeEdit(string BillId)
        {
            ControlJudgeTimeEntity project = null;

            //请继续添加一些需要赋值的值,如修改日期等等

            string msg    = "操作成功";
            bool   result = true;

            if (IsPostBack)
            {
                #region 提交数据
                //注意,int类型的主键只有一个构造函数,不需要生成主键
                if (!string.IsNullOrEmpty(BillId))
                {
                    //被认为是编辑
                    project = new ControlJudgeTimeEntity();
                    project.ResetForSearch();
                    project.BillId = BillId;
                    project.GetTable(true);
                }

                if (!project.IsGenerateObject)
                {
                    //请添加一些需要赋值的值
                    project.CreateMan  = UserEntity.Account;
                    project.CreateDate = DateTime.Now;
                }
                project.ModifyMan  = UserEntity.Account;
                project.ModifyDate = DateTime.Now;
                //请赋值其他不可见的属性



                //将页面的值转换成实体属性,注意,如果客户端转了主键回来,这里的主键将会被改变
                project.GenerateObjectFromRequest("");

                try
                {
                    project.Update();
                }
                catch
                {
                    msg    = "操作失败";
                    result = false;
                }
                return(base.GetJsonResult(msg, result, null));

                #endregion
            }
            else
            {//访问页面
                if (!string.IsNullOrEmpty(BillId))
                {
                    project = new ControlJudgeTimeEntity();
                    project.ResetForSearch();
                    project.BillId = BillId;
                    //将表传为实体
                    project.GetTable(true);
                }
                else
                {
                    project           = new ControlJudgeTimeEntity(true);
                    project.StartTime = DateTime.Now;
                    project.EndTime   = DateTime.Now;
                    project.IfValid   = 1;
                }
                return(View(project));
            }
        }
示例#2
0
        public JsonResult GetPorposalIdList(string BillId, string MeetingType)
        {
            //int MeetingType =Convert.ToInt32( Request.Form["MeetingType"]);
            JsonResult PorposalIdList = new JsonResult();

            PorposalIdList.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            object[]               objArr  = new object[] { };
            List <object>          objList = new List <object>();
            ControlJudgeTimeEntity controlJudgeTimeEntity = new ControlJudgeTimeEntity();

            controlJudgeTimeEntity.ResetForSearch();
            controlJudgeTimeEntity.BillId = BillId;
            controlJudgeTimeEntity.GetTable(true);
            string proposalIdList = controlJudgeTimeEntity.ProposalIdList;

            if (MeetingType.Equals("0"))
            {
                V_ProjectAssessmentEntityBillList v_ProjectAssessmentEntityBillList = new V_ProjectAssessmentEntityBillList();
                v_ProjectAssessmentEntityBillList.ResetForSearch();
                v_ProjectAssessmentEntityBillList.InternState   = "等待初评评分";
                v_ProjectAssessmentEntityBillList.IsOnlyGroupBy = true;

                DataTable dt = v_ProjectAssessmentEntityBillList.GetTable();
                foreach (DataRow singleRow in dt.Rows)
                {
                    var tempObj = new { text = "", proposalId = "", ischecked = false };
                    if (controlJudgeTimeEntity.IsGenerateObject == true && !string.IsNullOrEmpty(controlJudgeTimeEntity.ProposalIdList) && controlJudgeTimeEntity.ProposalIdList.Contains(singleRow["BillID"].ToString()))
                    {
                        tempObj = new { text = singleRow["ProposalName"].ToString(), proposalId = singleRow["BillID"].ToString(), ischecked = true };
                    }
                    else
                    {
                        tempObj = new { text = singleRow["ProposalName"].ToString(), proposalId = singleRow["BillID"].ToString(), ischecked = false };
                    }
                    objList.Add(tempObj);
                }
            }
            if (MeetingType.Equals("1"))
            {
                V_ReviewAccessmentEntityBillList v_ReviewAccessmentEntityBillList = new V_ReviewAccessmentEntityBillList();
                v_ReviewAccessmentEntityBillList.ResetForSearch();
                v_ReviewAccessmentEntityBillList.ReviewState = "等待复评评分";
                DataTable dt = v_ReviewAccessmentEntityBillList.GetTable();
                foreach (DataRow singleRow in dt.Rows)
                {
                    var tempObj = new { text = "", proposalId = "", ischecked = false };
                    if (controlJudgeTimeEntity.IsGenerateObject == true && !string.IsNullOrEmpty(controlJudgeTimeEntity.ProposalIdList) && controlJudgeTimeEntity.ProposalIdList.Contains(singleRow["BillID"].ToString()))
                    {
                        tempObj = new { text = singleRow["ProposalName"].ToString(), proposalId = singleRow["BillID"].ToString(), ischecked = true };
                    }
                    else
                    {
                        tempObj = new { text = singleRow["ProposalName"].ToString(), proposalId = singleRow["BillID"].ToString(), ischecked = false };
                    }
                    objList.Add(tempObj);
                }
            }
            objArr = objList.ToArray();
            PorposalIdList.Data = objArr;
            return(PorposalIdList);
        }