Пример #1
0
        /// <summary>
        /// 保存按纽点击执行结束方法
        /// </summary>
        protected void PageEnd()
        {
            //ajax返回信息
            string      resultmsg             = "";
            BIndividual bllBIndividual        = new BIndividual();
            MWorkPlan   modelMWorkReportCheck = new MWorkPlan();

            if (!string.IsNullOrEmpty(Utils.GetFormValue("WorkId")))
            {
                //根据编号获取工作计划实体
                modelMWorkReportCheck = bllBIndividual.GetWorkPlan(Utils.GetFormValue("WorkId"));
                if (modelMWorkReportCheck != null)
                {
                    if (Utils.GetFormValue("Status") == ((int)Status.已结束).ToString())
                    {
                        //审核状态
                        modelMWorkReportCheck.Status = Status.已结束;
                    }
                    else
                    {
                        resultmsg = UtilsCommons.AjaxReturnJson("false", "审核状态未勾选");
                        Response.Clear();
                        Response.Write(resultmsg);
                        Response.End();
                    }
                    //实际完成时间
                    if (!string.IsNullOrEmpty(Utils.GetFormValue("ActualTime")))
                    {
                        modelMWorkReportCheck.ActualTime = Utils.GetDateTime(Utils.GetFormValue("ActualTime"));
                    }
                    else
                    {
                        modelMWorkReportCheck.ActualTime = DateTime.Now;
                    }
                    //结束
                    modelMWorkReportCheck.Result = Utils.GetFormValue("Result");
                    //最后修改时间
                    modelMWorkReportCheck.UpdateTime = DateTime.Now;
                    if (bllBIndividual.SetWorkPlanEnd(modelMWorkReportCheck))
                    {
                        resultmsg = UtilsCommons.AjaxReturnJson("true", "结束成功");
                    }
                    else
                    {
                        resultmsg = UtilsCommons.AjaxReturnJson("false", "结束失败");
                    }
                }
                else
                {
                    resultmsg = UtilsCommons.AjaxReturnJson("false", "结束失败 无法获取结束数据");
                }
            }
            else
            {
                resultmsg = UtilsCommons.AjaxReturnJson("false", "结束失败 参数编号为空");
            }
            Response.Clear();
            Response.Write(resultmsg);
            Response.End();
        }