/// <summary> /// 删除批次 /// </summary> public void deletePlan() { try { int planId = int.Parse(Context.Request["deletePlanId"].ToString()); Result row = isDeletePlan(); if (row == Result.记录不存在) { Result result = planBll.Delete(planId); if (result == Result.除成功) { LogHelper.Info(this.GetType(), loginUser.TeaAccount + loginUser.TeaName + "-删除" + planId + "批次"); Response.Write("删除成功"); Response.End(); } else { Response.Write("删除失败"); Response.End(); } } else { Response.Write("在其他表中有关联不能删除"); Response.End(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
/// <summary> /// 删除收料计划,只有在待执行的时候可以删除 /// </summary> /// <param name="planCode"></param> /// <returns></returns> public ResponseData DeletePlan(string planCode) { ResponseData response = new ResponseData(); try { PlanMainModel plan = bllPlan.GetModelByPlanCode(planCode); if (plan == null) { response.Status = false; response.Describe = "不存在:[" + planCode + "]计划"; return(response); } if (plan.Plan_Status == EnumPlanStatus.执行中.ToString()) { response.Status = false; response.Describe = "收料计划已经在执行中不允许删除!"; return(response); } bllPlan.Delete(plan.Plan_ID); response.Status = true; response.Describe = "收料计划删除成功!"; return(response); } catch (Exception ex) { response.Status = false; response.Describe = "收料计划删除失败:" + ex.Message; return(response); } }
public void DeletePlanList(string planCode) { if (this.View.AskMessage("询问", "您确定要删除此计划么?") != 0) { return; } PlanMainModel planModel = bllPlan.GetModelByPlanCode(planCode); if (planModel == null) { return; } if (planModel.Plan_Status != EnumPlanStatus.待执行.ToString()) { this.View.ShowMessage("提示", "只有待执行的计划可以删除!"); return; } bllPlan.Delete(planModel.Plan_ID); QueryPlan(this.querySDate, this.queryEDate, this.queryPlanType, this.queryPlanCode); }