示例#1
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected void PageSave()
        {
            //ajax返回信息
            string         resultmsg           = "";
            BIndividual    bllBIndividual      = new BIndividual();
            MWorkPlanCheck modelMWorkPlanCheck = new MWorkPlanCheck();

            //审核人
            modelMWorkPlanCheck.Approver = SiteUserInfo.Name;
            //审核时间
            if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("ApproveTime")))
            {
                modelMWorkPlanCheck.ApproveTime = Utils.GetDateTime(Utils.GetQueryStringValue("ApproveTime"));
            }
            else
            {
                modelMWorkPlanCheck.ApproveTime = DateTime.Now;
            }
            if (Utils.GetFormValue("Status") == ((int)Status.已审批).ToString())
            {
                //审核状态
                modelMWorkPlanCheck.Status = (Status)Enum.Parse(typeof(Status), Utils.GetFormValue("Status"));
            }
            else
            {
                resultmsg = UtilsCommons.AjaxReturnJson("false", "审核状态未勾选");
                Response.Clear();
                Response.Write(resultmsg);
                Response.End();
            }
            //审核意见
            modelMWorkPlanCheck.Comment = Utils.GetFormValue("Comment");
            //审核人编号
            modelMWorkPlanCheck.ApproverId = SiteUserInfo.UserId;
            //计划编号
            modelMWorkPlanCheck.WorkPlanId = Utils.GetInt(Utils.GetFormValue("WorkPlanId"));
            //主键编号
            modelMWorkPlanCheck.Id = Utils.GetInt(Utils.GetFormValue("listId"));
            if (bllBIndividual.SetWorkPlanStatus(modelMWorkPlanCheck))
            {
                resultmsg = UtilsCommons.AjaxReturnJson("true", "审批成功");
            }
            else
            {
                resultmsg = UtilsCommons.AjaxReturnJson("false", "审批失败");
            }

            Response.Clear();
            Response.Write(resultmsg);
            Response.End();
        }