protected void btn_RepealPlan_Click(object sender, EventArgs e) { //最后,需要对选中项进行操作之前,不能忘了还要最后一次收集当前页的选中情况 CollectSelected(); this.Hidden_ITEMNO.Value = string.Empty; foreach (object tmp in this.SelectedItems) { this.Hidden_ITEMNO.Value += "'" + tmp.ToString() + "',"; } StringBuilder stringb = new StringBuilder(); stringb.Append(this.Hidden_ITEMNO.Value.Remove(this.Hidden_ITEMNO.Value.LastIndexOf(","))); string sqlString = "begin update tb_p_main_plan set plan_status=9,MODIFY_DT=sysdate where ORDER_ID_2 in (" + stringb + ")" + " ;"; sqlString += " update ORD_ORDERITEM set ITEMSTATE='09' where ITEMNO in (" + stringb + ")" + " ;"; sqlString += " delete from TB_P_MAIN_PLAN_D where MAIN_PLAN_ID in (select MAIN_PLAN_ID from tb_p_main_plan where ORDER_ID_2 in (" + stringb + "))" + " and PLAN_DATE>sysdate " + " ;"; //删除主计划明细表 sqlString += "update tb_p_sect_plan set plan_status=9,MODIFY_DT=sysdate where MAIN_PLAN_ID in (select MAIN_PLAN_ID from tb_p_main_plan where ORDER_ID_2 in (" + stringb + "))" + " and PLAN_S_DATE>sysdate " + ";"; sqlString += "delete from TB_P_SECT_PLAN_D where SECT_PLAN_ID in (select SECT_PLAN_ID from TB_P_SECT_PLAN where " + "MAIN_PLAN_ID in (select MAIN_PLAN_ID from tb_p_main_plan where ORDER_ID_2 in (" + stringb + "))" + " and PLAN_S_DATE>sysdate " + ") " + " and PLAN_DATE>sysdate " + " ;"; //删除工段主计划明细表 sqlString += "delete from TB_M_DISPATCH_TEMP where MAIN_ID in (select id from tb_m_dispatch where ORDER_ID_3 in (" + stringb + ") and ACT_COUNT=0 )" + " ;"; sqlString += "delete from tb_m_dispatch where ORDER_ID_3 in (" + stringb + ") and ACT_COUNT=0 " + " ; end;"; int result = 0; result = DbHelperOra.ExecuteSql(sqlString); if (result > 0) { Alert("撤销主计划成功!"); } else { Alert("撤销主计划失败!"); } PageQueryAdapter1.PerformQuery(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GridViewOrder.Columns[0].HeaderText = "选择"; GridViewOrder.Columns[1].HeaderText = GetString("lblORDER_ID"); GridViewOrder.Columns[2].HeaderText = GetString("lblstatus"); //初始化预排产排程 PageQueryAdapter1.PageSize = 20; PageQueryAdapter1.PerformQuery(); PageQueryAdapter2.PageSize = 20; PageQueryAdapter2.PerformQuery(); //初始化实际排程 } }
protected void gridUsers_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "Modify": PageQueryAdapter1.ReloadCurrentPage(); break; case "Remove": //RemoveUser(e.CommandArgument.ToString()); //删除逻辑 PageQueryAdapter1.ReloadCurrentPage(); break; default: break; } }
protected void btnSearch_Click(object sender, EventArgs e) { PageQueryAdapter1.PerformQuery(); }
protected void btnRefresh_Click(object sender, EventArgs e) { PageQueryAdapter1.ReloadCurrentPage(); }