Пример #1
0
    private void BatchAuditSubmit()
    {
        AjaxResult result = new AjaxResult();

        result.IsSuccess = false;
        result.Msg       = "操作失败!";
        if (Request.Form["cbx_select"] != null)
        {
            try
            {
                var arr          = Request.Form["cbx_select"].ToString().Split(',');
                var auditComment = Request.Form["BatchAuditComment"] ?? "";
                if (Request.Form["BatchAuditresult"] == "0")
                {
                    foreach (var item in arr)
                    {
                        var code = LZCodeUnitity.GetLZCode();
                        bll.Update(new RepetitivePlan {
                            Code = code, RepetPlanID = Guid.Parse(item)
                        }, "Code");
                        insdal.Submit(Guid.Parse(item), (int)TWFTypeEnum.RepetitivePlan, User.ID, User.UserName, User.RoleName.First(), auditComment, insdal.UpdateRepetPlan);
                    }
                }
                else
                {
                    foreach (var item in arr)
                    {
                        insdal.Terminate(Guid.Parse(item), (int)TWFTypeEnum.RepetitivePlan, User.ID, User.UserName, User.RoleName.First(), auditComment, insdal.UpdateRepetPlan);
                    }
                }
                result.IsSuccess = true;
                result.Msg       = "操作成功!";
            }
            catch (Exception)
            {
                result.IsSuccess = false;
                result.Msg       = "操作失败!";
            }
        }
        Response.Clear();
        Response.Write(result.ToJsonString());
        Response.ContentType = "application/json";
        Response.End();
    }
Пример #2
0
    private void AuditSubmit()
    {
        AjaxResult result = new AjaxResult();

        result.IsSuccess = false;
        result.Msg       = "提交失败!";
        var planid = Guid.Parse(Request.Form["id"]);

        try
        {
            var code = LZCodeUnitity.GetLZCode();
            bll.Update(new RepetitivePlan {
                Code = code, RepetPlanID = planid
            }, "Code");
            string ControlDep = "";
            if (Request.Form["Auditresult"] == "0")
            {
                if (!string.IsNullOrEmpty(Request.Form["ControlDep"]))
                {
                    ControlDep = Request.Form["ControlDep"];
                }
                insdal.Submit(planid, (int)TWFTypeEnum.RepetitivePlan, User.ID, User.UserName, User.RoleName.First(), Request.Form["AuditComment"] ?? "", insdal.UpdateRepetPlan, ControlDep);
            }
            else
            {
                insdal.TerminateGZ(planid, (int)TWFTypeEnum.RepetitivePlan, User.ID, User.UserName, User.RoleName.First(), Request.Form["AuditComment"] ?? "", insdal.UpdateRepetPlan);
            }
            result.IsSuccess = true;
            result.Msg       = "提交成功!";
        }
        catch (Exception)
        {
            result.IsSuccess = false;
            result.Msg       = "操作失败!";
        }
        Response.Clear();
        Response.Write(result.ToJsonString());
        Response.ContentType = "application/json";
        Response.End();
    }