/// <summary> /// 提交 /// </summary> /// <param name="planid"></param> /// <param name="userid"></param> /// <param name="username"></param> /// <returns></returns> public bool Submit(Guid planid, int userid, string username, string rolename, CurrentFlightPlanVM model) { //ActionWithTrans(() => //{ CurrentFlightPlan entity = new CurrentFlightPlan(); entity.CurrentFlightPlanID = Guid.NewGuid(); entity.FlightPlanID = planid.ToString(); entity.ActorID = userid; entity.PlanState = ""; //entity.Pilot = model.Pilot; //entity.ContractWay = model.ContractWay; entity.AircraftNum = model.AircraftNum; entity.ActualStartTime = model.ActualStartTime; entity.ActualEndTime = model.ActualEndTime; entity.Creator = userid; entity.CreatorName = username; dal.Add(entity); var currPlanId = entity.CurrentFlightPlanID; wftbll.CreateWorkflowInstance((int)TWFTypeEnum.CurrentPlan, currPlanId, userid, username); instal.Submit(currPlanId, (int)TWFTypeEnum.CurrentPlan, userid, username, rolename, "", workPlan => { dal.Update(new CurrentFlightPlan { ActorName = workPlan.ActorName, PlanState = workPlan.PlanState, CurrentFlightPlanID = workPlan.PlanID }, "ActorID", "PlanState"); }); //}); return(true); }
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(); }
private void Submit() { AjaxResult result = new AjaxResult(); result.IsSuccess = false; result.Msg = "提交失败!"; var planid = Guid.Parse(Request.Form["id"]); if (insdal.GetAllNodeInstance(planid, (int)TWFTypeEnum.FlightPlan).Count > 0) { result.Msg = "一条飞行计划无法创建两条申请流程,请联系管理员!"; } else { try { wftbll.CreateWorkflowInstance((int)TWFTypeEnum.FlightPlan, planid, User.ID, User.UserName); insdal.Submit(planid, (int)TWFTypeEnum.FlightPlan, User.ID, User.UserName, User.RoleName.First(), "", insdal.UpdateFlightPlan); result.IsSuccess = true; result.Msg = "提交成功!"; } catch (Exception e) { 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"]); 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(); }
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(); }