Esempio n. 1
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected void PageSave()
        {
            //ajax返回信息
            string           resultmsg             = "";
            BIndividual      bllBIndividual        = new BIndividual();
            MWorkReportCheck modelMWorkReportCheck = new MWorkReportCheck();

            //审核人
            modelMWorkReportCheck.Approver = SiteUserInfo.Name;
            string strApproveTime = "";

            if (!string.IsNullOrEmpty(Utils.GetFormValue("ApproveTime")))
            {
                strApproveTime = Utils.GetFormValue("ApproveTime");
            }
            else
            {
                strApproveTime = DateTime.Now.ToShortDateString();
            }
            //审核时间
            modelMWorkReportCheck.ApproveTime = Utils.GetDateTime(strApproveTime);
            if (Utils.GetFormValue("Status") == ((int)Status.已审批).ToString())
            {
                //审核状态
                modelMWorkReportCheck.Status = (Status)Enum.Parse(typeof(Status), Utils.GetFormValue("Status"));
            }
            else
            {
                resultmsg = UtilsCommons.AjaxReturnJson("false", "审核状态未勾选");
                Response.Clear();
                Response.Write(resultmsg);
                Response.End();
            }
            //审核意见
            modelMWorkReportCheck.Comment = Utils.GetFormValue("Comment");
            //审核人编号
            modelMWorkReportCheck.ApproverId = SiteUserInfo.UserId;
            //工作汇报编号
            modelMWorkReportCheck.WorkId = Utils.GetInt(Utils.GetFormValue("WorkId"));
            //主键编号
            modelMWorkReportCheck.Id = Utils.GetInt(Utils.GetFormValue("listId"));
            if (bllBIndividual.SetWorkReportStatus(modelMWorkReportCheck))
            {
                resultmsg = UtilsCommons.AjaxReturnJson("true", "审批成功");
            }
            else
            {
                resultmsg = UtilsCommons.AjaxReturnJson("false", "审批失败");
            }

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