/// <summary> /// databind 繫結查詢資料到GridView1 /// </summary> private void databind() { //抓取本頁初次登記的時間 string SessionIDName = "CGD061_" + PageTimeStamp.Value; CGDModel.ProcessDeliverTransDPS BCO = new CGDModel.ProcessDeliverTransDPS(ConntionDB); DataTable Dt; ParameterList.Clear(); ParameterList.Add(this.slp_ST_ACCEPT_DATE.StartDate); ParameterList.Add(this.slp_ST_ACCEPT_DATE.EndDate.ToString()); ParameterList.Add(this.txtPickNo.Text); Dt = BCO.QueryDeilyDPSitem(ParameterList); if (Dt.Rows.Count == 0) { ErrorMsgLabel.Text = "查無資料"; //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD061.aspx", "alert(' 查無資料 ');", true); } //#region 使用XML放置到前端資料 //MasterOLDData.InnerHtml = Dt.DataSet.GetXml(); //#endregion Session[SessionIDName] = Dt; GridView1.DataSource = Dt; //設定分頁大小 GridView1.PageIndex = 0; GridView1.DataBind(); }
/// <summary> /// 路線檢核鈕 /// </summary> protected void btnCheckRoute_Click(object sender, EventArgs e) { GridView2.Visible = true ; GridView3.Visible = false; DataTable Dt; ParameterList.Clear(); CGDModel.ProcessDeliverTransDPS BCO = new PIC.VDS2G.LGT.CGD.ProcessDeliverTransDPS(ConntionDB); ParameterList.Add(SLP_ST_ACCEPT_DATE.Text);//門市進貨日 ParameterList.Add(txtPickNo.Text);//理貨批次 Dt = BCO.CheckDPSLost(ParameterList); //抓取本頁初次登記的時間 string SessionIDName = "CGD062_" + PageTimeStamp.Value; Session[SessionIDName] = Dt; if (Dt.Rows.Count > 0) { GridView2.DataSource = Dt; GridView2.DataBind(); } else { GridView2.Visible = false; ErrorMsgLabel.Text = "查無差異資料"; //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD062.aspx", "alert(' 查無差異資料 ');", true); } }
/// <summary> /// 轉單(不重新裝箱) /// </summary> protected void btnQuery2_Click(object sender, EventArgs e) { btnBack.Enabled = false; btnCheckDPS.Enabled = false; btnCheckRoute.Enabled = false; btnQuery.Enabled = false; btnQuery2.Enabled = false; GridView2.Visible = false; GridView3.Visible = false; try { if (VerifyFormData()) { ParameterList.Clear(); CGDModel.ProcessDeliverTransDPS BCO = new PIC.VDS2G.LGT.CGD.ProcessDeliverTransDPS(ConntionDB); DataTable Dt; ParameterList.Add(SLP_ST_ACCEPT_DATE.Text); ParameterList.Add(txtPickNo.Text); ParameterList.Add(SLP_PICK_DATE.Text); ParameterList.Add(txtALLOW_WEIGHT.Text); ParameterList.Add(txtPERCENT_SET.Text); Dt = BCO.CheckDpsExist(ParameterList); if (Dt.Rows.Count > 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "if (confirm('理貨資料已存在,是否重新轉檔')){this.disabled=true;__doPostBack('Trans2','');}", true); } else { DoTrans2(); } } ParameterList.Clear(); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
/// <summary> /// 用Session傳來的條件進行查詢,顯示在畫面上的控制項 /// </summary> private void ShowData(string strAcceptDate, string strPickBatch, string strPickDate ) { // string[] strKey = (string[])Session["Key_" + SessionName]; //string SessionIDName = "CGD062_" + PageTimeStamp.Value; CGDModel.ProcessDeliverTransDPS BCO = new CGDModel.ProcessDeliverTransDPS(ConntionDB); DataTable Dt; ParameterList.Clear(); ParameterList.Add(strAcceptDate); ParameterList.Add(strPickBatch); ParameterList.Add(strPickDate); Dt = BCO.QueryDailyDPSitemData(ParameterList); if (Dt.Rows.Count == 0) { DisplayNoneData(Dt); ErrorMsgLabel.Text = "查無資料"; } else { DisplayData(Dt); } }
private void GetCGD061Data(string strDate, string endDate, string pickNo) { string SessionIDName = "CGD062_01_" + Request.QueryString["SessionTimeStamp"]; CGDModel.ProcessDeliverTransDPS BCO = new CGDModel.ProcessDeliverTransDPS(ConntionDB); DataTable Dt; ParameterList.Clear(); ParameterList.Add(strDate); ParameterList.Add(endDate); ParameterList.Add(pickNo); Dt = BCO.QueryDeilyDPSitem(ParameterList); Session[SessionIDName] = Dt; }
/// <summary> /// 轉單(不重新裝箱) /// </summary> private void DoTrans2() { DataTable Dt; string strErr = string.Empty; string strOperation = string.Empty; ParameterList.Clear(); CGDModel.ProcessDeliverTransDPS BCO = new PIC.VDS2G.LGT.CGD.ProcessDeliverTransDPS(ConntionDB); ParameterList.Add(SLP_ST_ACCEPT_DATE.Text);//門市進貨日 ParameterList.Add(txtPickNo.Text);//理貨批次 ParameterList.Add(SLP_PICK_DATE.Text);//理貨日期 ParameterList.Add(txtALLOW_WEIGHT.Text);//箱重量設定 ParameterList.Add(txtPERCENT_SET.Text);//箱容率設定 ParameterList.Add(Session["UID"].ToString());//使用者 Dt = BCO.TransToDPS2(ParameterList, DBT, out strErr, out strOperation); //如果沒有錯誤訊息或回傳的DataTable筆數為 0 ,表示正常執行結束 if (strErr.Length == 0 && (Dt == null || Dt.Rows.Count == 0)) { //顯示畫面資料 ShowData(SLP_ST_ACCEPT_DATE.Text, txtPickNo.Text, SLP_PICK_DATE.Text); } else { switch (strOperation) { case "DeleteMultiDPSData": if (strErr.Length > 0) { ErrorMsgLabel.Text = strErr; } break; //case "CheckDPSLost": // if (Dt.Rows.Count > 0) // { // GridView2.DataSource = Dt; // GridView2.DataBind(); // } // break; //case "CheckRouteLost": // if (Dt.Rows.Count > 0) // { // GridView2.DataSource = Dt; // GridView2.DataBind(); // } // break; case "TransToDPS": if (strErr.Length > 0) { ErrorMsgLabel.Text = strErr; } break; case "DoTransToSpecDPS": if (strErr.Length > 0) { ErrorMsgLabel.Text = strErr; } break; case "InsertDPSInfo": if (strErr.Length > 0) { ErrorMsgLabel.Text = strErr; } break; case "InsertDPSRouteInfo": if (strErr.Length > 0) { ErrorMsgLabel.Text = strErr; } break; case "CountDPSBoxno": if (strErr.Length > 0) { ErrorMsgLabel.Text = strErr; } break; } } btnBack.Enabled = true; btnCheckDPS.Enabled = true; btnCheckRoute.Enabled = true; btnQuery.Enabled = true; btnQuery2.Enabled = true; ParameterList.Clear(); }