protected void btnExec_Click(object sender, EventArgs e) { try { ErrorMsgLabel.Text = ""; GridView1.DataBind(); if (txtACCEPT_DATE.StartDate.Trim() == "") { ErrorMsgLabel.Text = "請輸入門市進貨日(起)"; return; } if (txtACCEPT_DATE.EndDate.Trim() == "") { ErrorMsgLabel.Text = "請輸入門市進貨日(迄)"; return; } if (txtPROMOTE_ID.Text.Trim() == "") { ErrorMsgLabel.Text = "請輸入檔期編號"; return; } if (rbtType2.Checked == true) { ErrorMsgLabel.Text = "請選擇未拆單狀態"; return; } ALOModel.ALO26_BCO BCO = new ALOModel.ALO26_BCO(ConnectionDB); ArrayList Para = new ArrayList(); Para.Clear(); Para.Add(txtACCEPT_DATE.StartDate); Para.Add(txtACCEPT_DATE.EndDate); Para.Add(txtPROMOTE_ID.Text); if (rbtType1.Checked == true) Para.Add("0"); else Para.Add("1"); Para.Add("9999"); DataTable dt = BCO.QueryData(Para); if (dt.Rows.Count == 0) { ErrorMsgLabel.Text = "查不到需要拆單的資料"; return; } Para.Clear(); Para.Add(txtACCEPT_DATE.StartDate); Para.Add(txtACCEPT_DATE.EndDate); Para.Add(txtPROMOTE_ID.Text); Para.Add(Session["UID"].ToString()); Para.Add(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")); BCO.EXE_ALL(Para); ErrorMsgLabel.Text = "拆單完成"; } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } finally { } }
protected void btnQuery_Click(object sender, EventArgs e) { ErrorMsgLabel.Text = ""; if (txtACCEPT_DATE.StartDate.Trim() == "") { ErrorMsgLabel.Text = "請輸入門市進貨日(起)"; return; } if (txtACCEPT_DATE.EndDate.Trim() == "") { ErrorMsgLabel.Text = "請輸入門市進貨日(迄)"; return; } if (txtPROMOTE_ID.Text.Trim() == "") { ErrorMsgLabel.Text = "請輸入檔期編號"; return; } string SessionIDName = string.Format("{0}_{1}", PAGE_DT_01, PageTimeStamp.Value); ALOModel.ALO26_BCO BCO = new ALOModel.ALO26_BCO(ConnectionDB); ArrayList Para = new ArrayList(); Para.Clear(); Para.Add(txtACCEPT_DATE.StartDate); Para.Add(txtACCEPT_DATE.EndDate); Para.Add(txtPROMOTE_ID.Text); if (rbtType1.Checked == true) Para.Add("0"); else Para.Add("1"); Para.Add(TextBoxRowCountLimit.Text); DataTable dt = BCO.QueryData(Para); Session[SessionIDName] = dt; GridView1.DataSource = dt; GridView1.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) <= 0) ? 10 : int.Parse(TextBoxPagesize.Text); GridView1.PageIndex = 0; GridView1.DataBind(); if (dt != null && dt.Rows.Count > 0) { } else { ErrorMsgLabel.Text = "查無資料"; } }
protected void btnExport_Click(object sender, EventArgs e) { ErrorMsgLabel.Text = ""; if (txtACCEPT_DATE.StartDate.Trim() == "") { ErrorMsgLabel.Text = "請輸入門市進貨日(起)"; return; } if (txtACCEPT_DATE.EndDate.Trim() == "") { ErrorMsgLabel.Text = "請輸入門市進貨日(迄)"; return; } if (txtPROMOTE_ID.Text.Trim() == "") { ErrorMsgLabel.Text = "請輸入檔期編號"; return; } ALOModel.ALO26_BCO BCO = new ALOModel.ALO26_BCO(ConnectionDB); ArrayList Para = new ArrayList(); Para.Clear(); Para.Add(txtACCEPT_DATE.StartDate); Para.Add(txtACCEPT_DATE.EndDate); Para.Add(txtPROMOTE_ID.Text); if (rbtType1.Checked == true) Para.Add("0"); else Para.Add("1"); Para.Add("99999"); DataTable dt = BCO.QueryData(Para); if (dt != null && dt.Rows.Count > 0) { Export_Excel(dt); } else { ErrorMsgLabel.Text = "查無資料"; } }