Exemple #1
0
    private void AuditSubmit()
    {
        AjaxResult result = new AjaxResult();

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

        if (Request.Form["Auditresult"] == "0")
        {
            if (!string.IsNullOrEmpty(Request.Form["ControlDep"]))
            {
                ControlDep = Request.Form["ControlDep"];
            }
            insdal.Submit(planid, (int)TWFTypeEnum.FlightPlan, User.ID, User.UserName, User.RoleName.First(), Request.Form["AuditComment"] ?? "", insdal.UpdateFlightPlan, ControlDep);
        }
        else
        {
            insdal.Terminate(planid, (int)TWFTypeEnum.FlightPlan, User.ID, User.UserName, User.RoleName.First(), Request.Form["AuditComment"] ?? "", insdal.UpdateFlightPlan);
        }
        result.IsSuccess = true;
        result.Msg       = "提交成功!";

        Response.Clear();
        Response.Write(result.ToJsonString());
        Response.ContentType = "application/json";
        Response.End();
    }
 /// <summary>
 /// 审核不通过
 /// </summary>
 /// <param name="planid"></param>
 /// <param name="comment"></param>
 /// <returns></returns>
 public bool Terminate(Guid planid, string comment, int userid, string userName, string roleName)
 {
     instal.Terminate(planid, (int)TWFTypeEnum.CurrentPlan, userid, userName, roleName, comment, workPlan =>
     {
         dal.Update(new CurrentFlightPlan {
             ActorID = workPlan.Actor, PlanState = workPlan.PlanState, CurrentFlightPlanID = workPlan.PlanID, Creator = userid, CreateTime = DateTime.Now
         }, "ActorID", "PlanState", "CreateUserId", "CreateTime");
     });
     return(true);
 }
    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, ActorID = User.ID
            }, "Code", "ActorID");
            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.Terminate(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();
    }
Exemple #4
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();
    }
    private void AuditSubmit()
    {
        AjaxResult result = new AjaxResult();

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

        if (plan != null)
        {
            var ControlDep = "";
            if (Request.Form["Auditresult"] == "0")
            {
                if (!string.IsNullOrEmpty(Request.Form["ControlDep"]))
                {
                    ControlDep = Request.Form["ControlDep"];
                }
                insdal.Submit(planid, (int)TWFTypeEnum.FlightPlan, User.ID, User.UserName, User.RoleName.First(), Request.Form["AuditComment"] ?? "", insdal.UpdateFlightPlan, ControlDep);
                var plan1 = bll.Get(planid);
                if (plan1 != null && plan1.PlanState == "end")
                {
                    #region 飞行计划审核完成后直接转到明天的当日动态,并提交
                    var entity = new CurrentFlightPlan();
                    //  entity.FillObject(plan);
                    entity.CurrentFlightPlanID = Guid.NewGuid();
                    entity.RepetPlanID         = plan.RepetPlanID;
                    entity.FlightPlanID        = plan.FlightPlanID.ToString();
                    entity.AircraftType        = plan.AircraftType;
                    entity.FlightType          = plan.FlightType;
                    // entity.AircraftNum =int.Parse(plan.AircraftNum);
                    entity.AirlineWorkText = plan.AirlineWorkText;
                    entity.AirportText     = plan.AirportText;
                    entity.ADEP            = plan.ADEP;
                    entity.ADES            = plan.ADES;
                    entity.SsrCode         = plan.SsrCode;
                    entity.CallSign        = plan.CallSign;
                    entity.Code            = plan.Code;
                    entity.PlanState       = "0";
                    entity.CompanyName     = plan.CompanyName;
                    entity.CompanyCode3    = plan.CompanyCode3;
                    entity.Creator         = plan.Creator.Value;
                    entity.CreatorName     = plan.CreatorName;
                    entity.ActorID         = plan.Creator.Value;
                    entity.Code            = plan.Code;
                    entity.CreateTime      = DateTime.Now.Date.AddDays(1);
                    if (currPlanBll.Add(entity))
                    {
                        wftbll.CreateWorkflowInstance((int)TWFTypeEnum.CurrentPlan, entity.CurrentFlightPlanID, entity.Creator, entity.CreatorName);
                        insdal.Submit(entity.CurrentFlightPlanID, (int)TWFTypeEnum.CurrentPlan, entity.Creator, entity.CreatorName, "", "", insdal.UpdateCurrentFlightPlan);
                    }
                    #endregion
                }
            }

            else
            {
                insdal.Terminate(planid, (int)TWFTypeEnum.FlightPlan, User.ID, User.UserName, User.RoleName.First(), Request.Form["AuditComment"] ?? "", insdal.UpdateFlightPlan);
            }
            result.IsSuccess = true;
            result.Msg       = "提交成功!";
        }
        Response.Clear();
        Response.Write(result.ToJsonString());
        Response.ContentType = "application/json";
        Response.End();
    }