private bool CheckWASH_YN() //檢查是否沖帳 { bool bResult = false; if (this.hid_Page_Status.Value == "VIEW" || this.hid_Page_Status.Value == "EDIT") { string strCode = string.Empty; try { if (Request["V_NO"] == null) { throw new Exception("載入頁面失敗!"); } else { strCode = Request["V_NO"].ToString(); } } catch { } ParameterList.Clear(); ParameterList.Add(strCode); //V_ID BCO.MaintainBondRecord BCO = new BCO.MaintainBondRecord(ConntionDB); DataTable dtCheck = BCO.QueryWashData(ParameterList); if (dtCheck.Rows[0]["BOND_REMAIN_AMT"].ToString() != dtCheck.Rows[0]["CHK_REMAIN_AMT"].ToString()) bResult = true; } return bResult; }
/// <summary> /// 初始檢視 & 編輯模式 /// </summary> private void Page_Status_VIEW_EDIT_LOAD() { if (this.hid_Page_Status.Value == "VIEW" || this.hid_Page_Status.Value == "EDIT") { #region 清空所有欄位 this.txt_BOND_NO.Text = string.Empty;//收款單號 this.txt_Z_O_ID.Text = string.Empty;//營業所/名稱 this.txt_Z_O.Text = string.Empty;//營業所/名稱 this.txt_SAL.Text = string.Empty;//營業人員/名稱 this.txt_SAL_ID.Text = string.Empty;//營業人員/名稱 this.slp_STORE_ID.Text = string.Empty;//客戶代號/名稱 this.txt_RFNO.Text = string.Empty;//統一編號/抬頭 this.txt_RFNO_TITLE.Text = string.Empty;//統一編號/抬頭 this.txt_BOND_ID.Text = string.Empty;//票據號碼 this.slp_BOND_TYPE.Text = string.Empty;//方式 this.slp_ACCEPT_BOND_DATE.Text = string.Empty;//收票日 this.slp_DUE_DATE.Text = string.Empty;//到期日 this.slp_BOND_AMT.Text = string.Empty;//金額 this.slp_POSTAGE.Text = string.Empty;//郵資 this.slp_REMAIN_AMT.Text = string.Empty;//沖帳餘額 this.slp_PAY_BANK.Text = string.Empty;//付款銀行 this.txt_PAY_ACCOUNT.Text = string.Empty;//付款帳號 this.slp_COLL_BANK.Text = string.Empty;//託收銀行 this.slp_COLL_ID.Text = string.Empty;//託收人員 this.slp_NB_COLL_DATE.Text = string.Empty;//票據託收日/交換日 this.txt_MEMO.Text = string.Empty;//注意事項 this.slp_REJECT_DATE.Text = string.Empty;//退票日 this.txt_REJECT_MEMO.Text = string.Empty;//退票原因 this.cb_UN_MONTH_CLOSE.Checked = false;//暫不月結註記 this.cb_EX_DUE_FLG.Checked = false;//兌現註記 this.cb_ENABLE.Checked = false;//有效註記 this.hid_CREATEDATE.Value = string.Empty; #endregion #region 取得檢視資料 string strNo = string.Empty; try { if (Request["V_NO"] == null) { throw new Exception("載入頁面失敗!"); } else { strNo = Request["V_NO"].ToString(); } } catch { } ParameterList.Clear(); ParameterList.Add(strNo); BCO.MaintainBondRecord BCO = new BCO.MaintainBondRecord(ConntionDB); dt = BCO.QueryByFind(ParameterList, null); string s_RequestString = Request.QueryString["CAA162_Type"]; if (dt.Rows.Count != 1 && s_RequestString != "ToolBar") { throw new Exception("查無收款單號:" + strNo + "的相關資料"); } else if (dt.Rows.Count != 1 && s_RequestString == "ToolBar") { throw new Exception("查無此筆資料或已被其他使用者刪除,請點選上一筆/下一筆鈕或回查詢頁重新查詢!"); } #endregion #region 將資料寫入頁面 this.txt_BOND_NO.Text = dt.Rows[0]["BOND_NO"].ToString();//收款單號 this.txt_Z_O_ID.Text = dt.Rows[0]["Z_O"].ToString();//營業所/名稱 this.txt_Z_O.Text = dt.Rows[0]["Z_O_NAME"].ToString(); ;//營業所/名稱 this.txt_SAL.Text = dt.Rows[0]["SAL_ID"].ToString();//營業人員/名稱 this.txt_SAL_ID.Text = dt.Rows[0]["SAL_ID_NAME"].ToString();//營業人員/名稱 this.slp_STORE_ID.Text = dt.Rows[0]["STORE_ID"].ToString();//客戶代號/名稱 this.txt_RFNO.Text = dt.Rows[0]["RFNO"].ToString();//統一編號/抬頭 this.txt_RFNO_TITLE.Text = dt.Rows[0]["TITLE"].ToString();//統一編號/抬頭 this.txt_BOND_ID.Text = dt.Rows[0]["BOND_ID"].ToString();//票據號碼 this.slp_BOND_TYPE.Text = dt.Rows[0]["BOND_TYPE"].ToString();//方式 this.slp_DUE_DATE.Text = dt.Rows[0]["DUE_DATE"].ToString();//收票日 this.slp_ACCEPT_BOND_DATE.Text = dt.Rows[0]["ACCEPT_BOND_DATE"].ToString();//到期日 this.slp_BOND_AMT.Text = dt.Rows[0]["BOND_AMT"].ToString();//金額 this.slp_POSTAGE.Text = dt.Rows[0]["POSTAGE"].ToString();//郵資 this.slp_REMAIN_AMT.Text = dt.Rows[0]["BOND_REMAIN_AMT"].ToString();//沖帳餘額 this.slp_PAY_BANK.Text = dt.Rows[0]["PAY_BANK"].ToString();//付款銀行 this.txt_PAY_ACCOUNT.Text = dt.Rows[0]["PAY_ACCOUNT"].ToString();//付款帳號 this.slp_COLL_BANK.Text = dt.Rows[0]["COLL_BANK"].ToString();//託收銀行 this.slp_COLL_ID.Text = dt.Rows[0]["COLL_ID"].ToString();//託收人員 this.slp_NB_COLL_DATE.Text = dt.Rows[0]["NB_COLL_DATE"].ToString();//票據託收日/交換日 this.txt_MEMO.Text = dt.Rows[0]["MEMO"].ToString();//注意事項 this.slp_REJECT_DATE.Text = dt.Rows[0]["REJECT_DATE"].ToString();//退票日 this.txt_REJECT_MEMO.Text = dt.Rows[0]["REJECT_MEMO"].ToString();//退票原因 this.cb_UN_MONTH_CLOSE.Checked = dt.Rows[0]["UN_MONTH_CLOSE"].ToString() == "0" ? false : true;//暫不月結註記 this.cb_EX_DUE_FLG.Checked = dt.Rows[0]["EX_DUE_FLG"].ToString() == "0" ? false : true;//兌現註記 this.cb_ENABLE.Checked = dt.Rows[0]["ENABLE"].ToString() == "0" ? false : true;//有效註記 this.hid_CREATEDATE.Value = DateTime.Parse(dt.Rows[0]["CREATEDATE"].ToString()).ToString("yyyy/MM/dd"); this.hid_WASH_STATUS.Value = dt.Rows[0]["WASH_STATUS"].ToString();//沖帳狀態(0=未沖帳) #endregion #region 設定ReadOnly #region 檢視模式 if (this.hid_Page_Status.Value == "VIEW") { this.txt_BOND_NO.ReadOnly = true; this.txt_BOND_NO.CssClass = "readtxtbox"; this.txt_Z_O_ID.ReadOnly = true; this.txt_Z_O_ID.CssClass = "readtxtbox"; this.txt_Z_O.ReadOnly = true; this.txt_Z_O.CssClass = "readtxtbox"; this.txt_SAL.ReadOnly = true; this.txt_SAL.CssClass = "readtxtbox"; this.txt_SAL_ID.ReadOnly = true; this.txt_SAL_ID.CssClass = "readtxtbox"; this.slp_STORE_ID.ReadOnly = true; this.txt_RFNO.ReadOnly = true; this.txt_RFNO.CssClass = "readtxtbox"; this.txt_RFNO_TITLE.ReadOnly = true; this.txt_RFNO_TITLE.CssClass = "readtxtbox"; this.txt_BOND_ID.ReadOnly = true; this.txt_BOND_ID.CssClass = "readtxtbox"; this.slp_BOND_TYPE.ReadOnly = true; this.slp_ACCEPT_BOND_DATE.ReadOnly = true; this.slp_DUE_DATE.ReadOnly = true; this.slp_BOND_AMT.ReadOnly = true; this.slp_POSTAGE.ReadOnly = true; this.slp_REMAIN_AMT.ReadOnly = true; this.slp_PAY_BANK.ReadOnly = true; this.txt_PAY_ACCOUNT.ReadOnly = true; this.txt_PAY_ACCOUNT.CssClass = "readtxtbox"; this.slp_COLL_BANK.ReadOnly = true; this.slp_COLL_ID.ReadOnly = true; this.slp_NB_COLL_DATE.ReadOnly = true; this.txt_MEMO.ReadOnly = true; this.txt_MEMO.CssClass = "readtxtbox"; this.slp_REJECT_DATE.ReadOnly = true; this.txt_REJECT_MEMO.ReadOnly = true; this.txt_REJECT_MEMO.CssClass = "readtxtbox"; this.cb_UN_MONTH_CLOSE.Enabled = false; this.cb_EX_DUE_FLG.Enabled = false; this.cb_ENABLE.Enabled = false; } #endregion #region 編輯模式 if (this.hid_Page_Status.Value == "EDIT") { this.txt_BOND_NO.ReadOnly = true; this.txt_Z_O_ID.ReadOnly = true; this.txt_Z_O.ReadOnly = true; this.txt_SAL.ReadOnly = true; this.txt_SAL_ID.ReadOnly = true; this.txt_RFNO.ReadOnly = true; this.txt_RFNO_TITLE.ReadOnly = true; this.slp_REJECT_DATE.ReadOnly = true; this.txt_REJECT_MEMO.ReadOnly = true; this.cb_UN_MONTH_CLOSE.Enabled = false; this.cb_EX_DUE_FLG.Enabled = false; this.cb_ENABLE.Enabled = false; } #endregion #endregion } }
private bool Check_BOND_Monthly() { bool bResult = false; #region 傳入參數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_ACCEPT_BOND_DATE.Text, "date", false));//20091223改為利用[收票日]來判斷 #endregion #region 連結資料庫 string str_Result = string.Empty; BCO.MaintainBondRecord BCO = new BCO.MaintainBondRecord(ConntionDB); str_Result = BCO.CheckBondRecord(ParameterList); #endregion #region 檢查回傳資料 if (str_Result == "Y") { bResult = true; } #endregion return bResult; }
/// <summary> /// 編輯模式下按下[儲存]鈕 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Update_Click(object sender, EventArgs e) { try { #region 檢查條件 BCO.CAACommon CAAComm = new BCO.CAACommon(); ArrayList arl_Check_Condition = Check_Condition("Edit"); #region 如果檢查有誤,則Return if (arl_Check_Condition[1].ToString() != string.Empty) { #region 錯誤訊息 this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString(); #endregion #region Focus欄位 if (arl_Check_Condition[0].ToString() != string.Empty) { string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "CAA162", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion #region 傳入參數 string strMsg = string.Empty; string strNowDate = DateTime.Now.ToString(); string strNo = dt.Rows[0]["BOND_NO"].ToString(); string str_UN_MONTH_CLOSE = "0"; if (this.cb_UN_MONTH_CLOSE.Checked == true) { str_UN_MONTH_CLOSE = "1"; } string str_EX_DUE_FLG = "0"; if (this.cb_EX_DUE_FLG.Checked == true) { str_EX_DUE_FLG = "1"; } ParameterList.Clear(); //舊資料 ParameterList.Add(CAAComm.GetValueSetParameter(dt.Rows[0]["BOND_NO"].ToString(), "string", false)); //V_OLD_BOND_NO ParameterList.Add(CAAComm.GetValueSetParameter(dt.Rows[0]["CREATEDATE"].ToString(), "datetime", false)); //D_OLD_CREATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(dt.Rows[0]["CREATEUID"].ToString(), "string", false)); //V_OLD_CREATEUID ParameterList.Add(CAAComm.GetValueSetParameter(dt.Rows[0]["UPDATEDATE"].ToString(), "datetime", false)); //D_OLD_UPDATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(dt.Rows[0]["UPDATEUID"].ToString(), "string", false)); //V_OLD_UPDATEUID //新資料 ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_NO.Text, "string", false)); //V_NEW_BOND_NO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_STORE_ID.Text, "string", false)); //V_NEW_STORE_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_ID.Text.ToUpper(), "string", false)); //V_NEW_BOND_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_BOND_TYPE.Text, "string", false)); //V_NEW_BOND_TYPE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_ACCEPT_BOND_DATE.Text, "date", false)); //D_NEW_ACCEPT_BOND_DATE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_DUE_DATE.Text, "date", false)); //D_NEW_DUE_DATE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_BOND_AMT.Text, "int", false)); //N_NEW_BOND_AMT ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_POSTAGE.Text, "int", false)); //N_NEW_POSTAGE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_PAY_BANK.Text, "string", false)); //V_NEW_PAY_BANK ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_PAY_ACCOUNT.Text, "string", false)); //V_NEW_PAY_ACCOUNT ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_COLL_BANK.Text, "string", false)); //V_NEW_COLL_BANK ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_COLL_ID.Text, "string", false)); //V_NEW_COLL_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_NB_COLL_DATE.Text, "date", false)); //D_NEW_NB_COLL_DATE ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_MEMO.Text, "string", false)); //V_NEW_MEMO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_REJECT_DATE.Text, "date", false)); //D_NEW_REJECT_DATE ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_REJECT_MEMO.Text, "string", false)); //V_NEW_REJECT_MEMO ParameterList.Add(CAAComm.GetValueSetParameter(str_UN_MONTH_CLOSE, "string", false)); //V_NEW_UN_MONTH_CLOSE ParameterList.Add(CAAComm.GetValueSetParameter(str_EX_DUE_FLG, "string", false)); //V_NEW_EX_DUE_FLG ParameterList.Add(CAAComm.GetValueSetParameter(strNowDate, "datetime", false)); //D_NEW_UPDATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_NEW_UPDATEUID #endregion #region 組合跳轉頁面字串 string s_ADDLocation_Replace_String = string.Empty; try { int i_Count = int.Parse(Request.QueryString["CAA162_COUNT"]); string s_Request_Key = Request.QueryString["CAA162_PageTimeStamp"]; s_ADDLocation_Replace_String = "&CAA162_COUNT=" + i_Count.ToString() + "&CAA162_PageTimeStamp=" + s_Request_Key; } catch { s_ADDLocation_Replace_String = string.Empty; } #endregion #region 連結資料庫 BCO.MaintainBondRecord bco = new BCO.MaintainBondRecord(ConntionDB); ArrayList aryUpd = bco.UpdateBondRecord(ParameterList, null); #endregion #region 跳轉頁面至檢視模式 strMsg = "alert('" + aryUpd[1].ToString() + "');location.replace('CAA162.aspx?V_NO=" + strNo + "&mode=VIEW&Code=CAA16" + s_ADDLocation_Replace_String + "');"; ScriptManager.RegisterStartupScript(this.btn_Update, this.GetType(), "TO_CAA162.aspx", strMsg, true); #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }
private bool Check_StoreDate(string s_Store_Id, DateTime d_Date) { bool bResult = false; #region 傳入參數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(s_Store_Id, "string", false));//店號 ParameterList.Add(CAAComm.GetValueSetParameter(d_Date.ToString(), "datetime", false));//時間 ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//登入人員 #endregion #region 連結資料庫 DataTable dt_Return = new DataTable(); BCO.MaintainBondRecord bco = new BCO.MaintainBondRecord(ConntionDB); dt_Return = bco.GET_STORE_RELATE_DATA(ParameterList); #endregion #region 檢查回傳資料 if (dt_Return.Rows.Count == 1) { bResult = true; } #endregion return bResult; }
private bool Check_BOND_ID() { bool bResult = false; #region 傳入參數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_NO.Text, "string", false));//收款單號 ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_ID.Text.ToUpper(), "string", false));//票據號碼 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_DUE_DATE.Text, "date", false));//到期日 ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//登入人員 #endregion #region 連結資料庫 DataTable dt_Return = new DataTable(); BCO.MaintainBondRecord bco = new BCO.MaintainBondRecord(ConntionDB); dt_Return = bco.CHECK_BOND_ID(ParameterList); #endregion #region 檢查回傳資料 if (dt_Return.Rows.Count == 0) { bResult = true; } #endregion return bResult; }
/// <summary> /// 初始檢視模式 /// </summary> private void Page_Status_VIEW_EDIT_LOAD() { if (hid_Page_Status.Value == "VIEW") { #region 清空所有欄位 this.txt_Z_O_ID.Text = string.Empty;//營業所/名稱 this.txt_Z_O.Text = string.Empty;//營業所/名稱 this.txt_SAL.Text = string.Empty;//營業人員/名稱 this.txt_SAL_ID.Text = string.Empty;//營業人員/名稱 this.slp_STORE_ID.Text = string.Empty;//客戶代號/名稱 this.txt_RFNO.Text = string.Empty;//統一編號/抬頭 this.txt_RFNO_TITLE.Text = string.Empty;//統一編號/抬頭 this.txt_BOND_ID.Text = string.Empty;//票據號碼 this.slp_BOND_TYPE.Text = string.Empty;//方式 this.slp_ACCEPT_BOND_DATE.Text = string.Empty;//收票日 this.slp_DUE_DATE.Text = string.Empty;//到期日 this.slp_BOND_AMT.Text = string.Empty;//金額 this.slp_POSTAGE.Text = string.Empty;//郵資 this.slp_REMAIN_AMT.Text = string.Empty;//沖帳餘額 this.slp_PAY_BANK.Text = string.Empty;//付款銀行 this.txt_PAY_ACCOUNT.Text = string.Empty;//付款帳號 this.slp_COLL_BANK.Text = string.Empty;//託收銀行 this.slp_COLL_ID.Text = string.Empty;//託收人員 this.slp_NB_COLL_DATE.Text = string.Empty;//票據託收日/交換日 this.txt_MEMO.Text = string.Empty;//注意事項 this.slp_REJECT_DATE.Text = string.Empty;//退票日 this.txt_REJECT_MEMO.Text = string.Empty;//退票原因 this.cb_UN_MONTH_CLOSE.Checked = false;//暫不月結註記 this.cb_EX_DUE_FLG.Checked = false;//兌現註記 this.cb_ENABLE.Checked = false;//有效註記 #endregion #region 取得檢視資料 string strNo = string.Empty; try { if (Request["V_NO"] == null) { throw new Exception("載入頁面失敗!"); } else { strNo = Request["V_NO"].ToString(); } } catch { } ParameterList.Clear(); ParameterList.Add(strNo); CAAModel.MaintainBondRecord BCO = new CAAModel.MaintainBondRecord(ConntionDB); dt = BCO.QueryByFind(ParameterList, null); #endregion #region 將資料寫入頁面 this.txt_BOND_NO.Text = dt.Rows[0]["BOND_NO"].ToString();//託收單號 this.txt_Z_O_ID.Text = dt.Rows[0]["Z_O"].ToString();//營業所/名稱 this.txt_Z_O.Text = dt.Rows[0]["Z_O_NAME"].ToString();//營業所/名稱 this.txt_SAL.Text = dt.Rows[0]["SAL_ID"].ToString();//營業人員/名稱 this.txt_SAL_ID.Text = dt.Rows[0]["SAL_ID_NAME"].ToString();//營業人員/名稱 this.slp_STORE_ID.Text = dt.Rows[0]["STORE_ID"].ToString();//客戶代號/名稱 this.txt_RFNO.Text = dt.Rows[0]["RFNO"].ToString();//統一編號/抬頭 this.txt_RFNO_TITLE.Text = dt.Rows[0]["TITLE"].ToString();//統一編號/抬頭 this.txt_BOND_ID.Text = dt.Rows[0]["BOND_ID"].ToString();//票據號碼 this.slp_BOND_TYPE.Text = dt.Rows[0]["BOND_TYPE"].ToString();//方式 this.slp_DUE_DATE.Text = dt.Rows[0]["DUE_DATE"].ToString();//到期日 this.slp_ACCEPT_BOND_DATE.Text = dt.Rows[0]["ACCEPT_BOND_DATE"].ToString();//收票日 this.slp_BOND_AMT.Text = dt.Rows[0]["BOND_AMT"].ToString();//金額 this.slp_POSTAGE.Text = dt.Rows[0]["POSTAGE"].ToString();//郵資 this.slp_REMAIN_AMT.Text = dt.Rows[0]["BOND_REMAIN_AMT"].ToString();//沖帳餘額 this.slp_PAY_BANK.Text = dt.Rows[0]["PAY_BANK"].ToString();//付款銀行 this.txt_PAY_ACCOUNT.Text = dt.Rows[0]["PAY_ACCOUNT"].ToString();//付款帳號 this.slp_COLL_BANK.Text = dt.Rows[0]["COLL_BANK"].ToString();//託收銀行 this.slp_COLL_ID.Text = dt.Rows[0]["COLL_ID"].ToString();//託收人員 this.slp_NB_COLL_DATE.Text = dt.Rows[0]["NB_COLL_DATE"].ToString();//票據託收日/交換日 this.txt_MEMO.Text = dt.Rows[0]["MEMO"].ToString();//注意事項 this.slp_REJECT_DATE.Text = dt.Rows[0]["REJECT_DATE"].ToString();//退票日 this.txt_REJECT_MEMO.Text = dt.Rows[0]["REJECT_MEMO"].ToString();//退票原因 this.cb_UN_MONTH_CLOSE.Checked = dt.Rows[0]["UN_MONTH_CLOSE"].ToString() == "0" ? false : true;//暫不月結註記 this.cb_EX_DUE_FLG.Checked = dt.Rows[0]["EX_DUE_FLG"].ToString() == "0" ? false : true;//兌現註記 this.cb_ENABLE.Checked = dt.Rows[0]["ENABLE"].ToString() == "0" ? false : true;//有效註記 #endregion #region 設定ReadOnly this.txt_BOND_NO.ReadOnly = true; this.txt_BOND_NO.CssClass = "readtxtbox"; this.txt_Z_O_ID.ReadOnly = true; this.txt_Z_O_ID.CssClass = "readtxtbox"; this.txt_Z_O.ReadOnly = true; this.txt_Z_O.CssClass = "readtxtbox"; this.txt_SAL.ReadOnly = true; this.txt_SAL.CssClass = "readtxtbox"; this.txt_SAL_ID.ReadOnly = true; this.txt_SAL_ID.CssClass = "readtxtbox"; this.slp_STORE_ID.ReadOnly = true; this.txt_RFNO.ReadOnly = true; this.txt_RFNO.CssClass = "readtxtbox"; this.txt_RFNO_TITLE.ReadOnly = true; this.txt_RFNO_TITLE.CssClass = "readtxtbox"; this.slp_BOND_TYPE.ReadOnly = true; this.slp_ACCEPT_BOND_DATE.ReadOnly = true; this.slp_BOND_AMT.ReadOnly = true; this.slp_POSTAGE.ReadOnly = true; this.slp_REMAIN_AMT.ReadOnly = true; this.slp_PAY_BANK.ReadOnly = true; this.txt_PAY_ACCOUNT.ReadOnly = true; this.txt_PAY_ACCOUNT.CssClass = "readtxtbox"; this.slp_COLL_BANK.ReadOnly = true; this.slp_COLL_ID.ReadOnly = true; this.txt_MEMO.ReadOnly = true; this.txt_MEMO.CssClass = "readtxtbox"; this.cb_EX_DUE_FLG.Enabled = false; this.cb_ENABLE.Enabled = false; if (this.hdf_flag.Value == "Y") { this.slp_REJECT_DATE.ReadOnly = true; } #endregion } }
/// <summary> /// 新增 & 編輯 模式下離開[客戶代號/名稱]帶出相關資料 /// </summary> private void txt_STORE_ID_Onblur() { #region 規則 /* * 與秀玲確認過 * 抓取店號帶出相關資料的部份 * 在[新增]狀態下,要用 sysdate 作為查詢條件 * 在[編輯]狀態下,要用 createdate 作為查詢條件(編輯畫面load進來時,和使用者修改店號時都要以該筆資料的createdate為主) * 來查出 [VDS_STM_STORE][VDS_STM_ACCOUNT_PROPERTY] 這兩個Table當時的資料 */ #endregion try { #region 新增 or 編輯 模式 BCO.CAACommon CAAComm = new BCO.CAACommon(); if (this.hid_Page_Status.Value == "INSERT" || this.hid_Page_Status.Value == "EDIT") { #region 重新將店號再寫入一次 this.slp_STORE_ID.Text = this.slp_STORE_ID.Text; #endregion if (this.slp_STORE_ID.Text.Trim() == string.Empty) { #region 將欄位清空 this.txt_Z_O_ID.Text = string.Empty;//營業所 this.txt_Z_O.Text = string.Empty;//營業所名稱 this.txt_SAL.Text = string.Empty;//營業人員 this.txt_SAL_ID.Text = string.Empty;//營業人員名稱 this.txt_RFNO.Text = string.Empty;//統一編號 this.txt_RFNO_TITLE.Text = string.Empty;//統一編號抬頭 #endregion #region Focus欄位 string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(this.txt_BOND_ID.ClientID, true); ScriptManager.RegisterStartupScript(this.up_Condition, typeof(UpdatePanel), "CAA162", s_ScriptManager_Script, true); #endregion } else { #region 傳入參數 DateTime d_Date; d_Date = DateTime.Parse(this.hid_CREATEDATE.Value); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_STORE_ID.Text, "string", false));//店號 ParameterList.Add(CAAComm.GetValueSetParameter(d_Date.ToString(), "datetime", false));//時間 ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//V_LOG_UPDATEUID #endregion #region 連結資料庫 BCO.MaintainBondRecord BCO = new BCO.MaintainBondRecord(ConntionDB); DataTable dt_Return = BCO.GET_STORE_RELATE_DATA(ParameterList); #endregion #region 檢查回傳資料 if (dt_Return.Rows.Count != 1) { #region 將欄位清空 this.txt_Z_O_ID.Text = string.Empty;//營業所 this.txt_Z_O.Text = string.Empty;//營業所名稱 this.txt_SAL.Text = string.Empty;//營業人員 this.txt_SAL_ID.Text = string.Empty;//營業人員名稱 this.txt_RFNO.Text = string.Empty;//統一編號 this.txt_RFNO_TITLE.Text = string.Empty;//統一編號抬頭 #endregion #region 若發生錯誤則alert訊息(秀玲要alert訊息) //若發生錯誤,則只要alert錯誤訊息,不要focus到[店號]欄位 string s_ScriptManager_Script = "alert('無符合店號或己關店,請重新輸入')"; ScriptManager.RegisterStartupScript(this.up_Condition, typeof(UpdatePanel), "CAA162", s_ScriptManager_Script, true); #endregion return; } #endregion #region 將資料寫入頁面 else { this.txt_Z_O_ID.Text = dt_Return.Rows[0]["Z_O"].ToString();//營業所 this.txt_Z_O.Text = dt_Return.Rows[0]["Z_O_NAME"].ToString();//營業所名稱 this.txt_SAL.Text = dt_Return.Rows[0]["SAL_ID"].ToString();//營業人員 this.txt_SAL_ID.Text = dt_Return.Rows[0]["SAL_ID_NAME"].ToString();//營業人員名稱 this.txt_RFNO.Text = dt_Return.Rows[0]["RFNO"].ToString();//統一編號 this.txt_RFNO_TITLE.Text = dt_Return.Rows[0]["TITLE"].ToString();//統一編號抬頭 #region Focus欄位 string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(this.txt_BOND_ID.ClientID, true); ScriptManager.RegisterStartupScript(this.up_Condition, typeof(UpdatePanel), "CAA162", s_ScriptManager_Script, true); #endregion } #endregion } } #endregion #region 如果不符合以上條件,代表錯誤 else { throw new Exception("頁面資料錯誤,只有在[新增 or 編輯模式]下,才有欄位[店號]Onblur事件"); } #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }
/// <summary> /// 儲存到期日,票據託收日,票據號碼異動 因為是總帳不用考慮是否沖帳及月結 /// </summary> protected void btn_Save_Click(object sender, EventArgs e) { try { #region 檢查條件 CAAModel.CAACommon CAAComm = new CAAModel.CAACommon(); ArrayList arl_Check_Condition = Check_Condition(); #region 如果檢查有誤,則Return if (arl_Check_Condition[1].ToString() != string.Empty) { #region 錯誤訊息 this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString(); #endregion #region Focus欄位 if (arl_Check_Condition[0].ToString() != string.Empty) { string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true); ScriptManager.RegisterStartupScript(Page, this.GetType(), "TO_CAA122.aspx", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion string strMsg = string.Empty; string strNo = dt.Rows[0]["BOND_NO"].ToString(); string strNowDate = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); DateTime EX_DUE_DATE = new DateTime(); string txt_BOND_ID = this.txt_BOND_ID.Text.ToString(); DateTime slp_DUE_DATE = Convert.ToDateTime(this.slp_DUE_DATE.Text.ToString()); DateTime slp_NB_COLL_DATE = Convert.ToDateTime(this.slp_NB_COLL_DATE.Text.ToString()); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(strNo, "string", false)); //V_BOND_NO ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_UPDATEUID ParameterList.Add(CAAComm.GetValueSetParameter(strNowDate, "datetime", false)); //D_UPDATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_ID.Text.ToUpper(), "string", false)); //V_NEW_BOND_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_DUE_DATE.Text, "date", false)); //D_NEW_DUE_DATE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_NB_COLL_DATE.Text, "date", false)); //D_NEW_NB_COLL_DATE //若未兌現,則要更改預計兌現日 if (this.cb_EX_DUE_FLG.Checked == false) { /*20100514新增規則 判斷[票據托收日(DUE_DATE)]及[到期日(NB_COLL_DATE)]何者為大=> * 取大的日期+3天(含假日)置放回[票據預計兌現日(EX_DUE_DATE)]*/ if (slp_DUE_DATE >= slp_NB_COLL_DATE) { EX_DUE_DATE = slp_DUE_DATE.AddDays(3); } else { EX_DUE_DATE = slp_NB_COLL_DATE.AddDays(3); } ParameterList.Add(CAAComm.GetValueSetParameter(EX_DUE_DATE.ToString(), "date", false)); //D_EX_DUE_DATE } else { ParameterList.Add(CAAComm.GetValueSetParameter("", "string", false)); //D_EX_DUE_DATE } CAAModel.MaintainBondRecord BCO = new CAAModel.MaintainBondRecord(ConntionDB); ArrayList ary = BCO.UpdateCAA12BondRecord(ParameterList, null); #region 組合跳轉頁面字串 string s_ADDLocation_Replace_String = string.Empty; try { int i_Count = int.Parse(Request.QueryString["CAA122_COUNT"]); string s_Request_Key = Request.QueryString["CAA122_PageTimeStamp"]; s_ADDLocation_Replace_String = "&CAA122_COUNT=" + i_Count.ToString() + "&CAA122_PageTimeStamp=" + s_Request_Key; } catch { s_ADDLocation_Replace_String = string.Empty; } #endregion strMsg = "alert('" + ary[1].ToString() + "');"; ScriptManager.RegisterStartupScript(Page, this.GetType(), "TO_CAA122.aspx", strMsg, true); } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } finally { Finally_Function(); } }
/// <summary> /// 退票 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Reject_Click(object sender, EventArgs e) { if (this.slp_REJECT_DATE.Text != string.Empty && this.txt_REJECT_MEMO.Text != string.Empty) { try { string strMsg = string.Empty; string strNo = dt.Rows[0]["BOND_NO"].ToString(); string strNowDate = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); CAAModel.CAACommon CAAComm = new CAAModel.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(strNo, "string", false)); //V_BOND_NO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_REJECT_DATE.Text, "date", false)); //D_REJECT_DATE ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_REJECT_MEMO.Text, "string", false)); //V_REJECT_MEMO ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_UPDATEUID ParameterList.Add(CAAComm.GetValueSetParameter(strNowDate, "datetime", false)); //D_UPDATEDATE CAAModel.MaintainBondRecord BCO = new CAAModel.MaintainBondRecord(ConntionDB); ArrayList ary = BCO.BondRejectRecord(ParameterList, null); #region 組合跳轉頁面字串 string s_ADDLocation_Replace_String = string.Empty; try { int i_Count = int.Parse(Request.QueryString["CAA122_COUNT"]); string s_Request_Key = Request.QueryString["CAA122_PageTimeStamp"]; s_ADDLocation_Replace_String = "&CAA122_COUNT=" + i_Count.ToString() + "&CAA122_PageTimeStamp=" + s_Request_Key; } catch { s_ADDLocation_Replace_String = string.Empty; } #endregion strMsg = "alert('" + ary[1].ToString() + "');"; ScriptManager.RegisterStartupScript(Page, this.GetType(), "TO_CAA122.aspx", strMsg, true); } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } finally { Finally_Function(); } } else { this.ErrorMsgLabel.Text = "退票日及退票原因不可為空值!"; } }
/// <summary> /// 頁籤=整批兌現 BUTTON 整批兌現 /// </summary> protected void btn_Batch_Click(object sender, EventArgs e) { try { #region 將GridView的資訊寫入TempTable bool b_IsRightExecute = false; Set_GridViewValue_To_TempTable(out b_IsRightExecute); #endregion #region 如果將GridView的資訊寫入TempTable有誤,則 return if (b_IsRightExecute == false) { dt_Bulk = null; this.gv_Bulk.DataSource = dt_Bulk; this.gv_Bulk.DataBind(); this.ErrorMsgLabel.Text = "系統錯誤,請聯絡系統管理員!"; return; } #endregion #region 將有勾選的資料挑選出來 DataRow[] dr_Checked = null; if (dt_Bulk != null) { dr_Checked = dt_Bulk.Select("CHB_ITEM = 'true'"); } #endregion #region 檢查條件 BCO.CAACommon CAAComm = new BCO.CAACommon(); ArrayList arl_Check_Condition = Check_Condition("頁籤=整批兌現 BUTTON [整批兌換]鈕", dr_Checked); #region 如果檢查有誤,則Return if (arl_Check_Condition[1].ToString() != string.Empty) { #region 錯誤訊息 this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString(); #endregion #region Focus欄位 if (arl_Check_Condition[0].ToString() != string.Empty) { string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true); ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CAA121", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion #region 傳入參數 string s_Now = DateTime.Now.ToString(); ParameterList.Clear(); ParameterList.Add(dr_Checked); ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_tab2_NB_COLL_DATE.Text, "string", false)); ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); ParameterList.Add(CAAComm.GetValueSetParameter(s_Now, "datetime", false)); #endregion #region 連結資料庫 BCO.MaintainBondRecord bco = new BCO.MaintainBondRecord(ConntionDB); bco.BondBatchDueAll(ParameterList, null); #endregion #region 清空TempTable dt_Bulk = null; this.gv_Bulk.DataSource = dt_Bulk; this.gv_Bulk.DataBind(); this.ErrorMsgLabel.Text = "整批異動成功"; #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }
/// <summary> /// 頁籤=整批兌現 BUTTON 查詢 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void but_tab2_Query_Click(object sender, EventArgs e) { try { #region 檢查條件 BCO.CAACommon CAAComm = new BCO.CAACommon(); ArrayList arl_Check_Condition = Check_Condition("頁籤=整批兌現 BUTTON [查詢]鈕"); #region 如果檢查有誤,則Return if (arl_Check_Condition[1].ToString() != string.Empty) { #region 錯誤訊息 this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString(); #endregion #region Focus欄位 if (arl_Check_Condition[0].ToString() != string.Empty) { string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true); ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CAA121", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion #region 傳入參數 ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_tab2_EX_DUE_DATE.StartDate, "date", false)); //[票據預計兌現日]起 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_tab2_EX_DUE_DATE.EndDate, "date", false)); //[票據預計兌現日]迄 ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //登入人員 #endregion #region 連結資料庫 BCO.MaintainBondRecord bco = new BCO.MaintainBondRecord(ConntionDB); dt_Bulk = bco.QUERY_CAA121_BULK(ParameterList); #endregion #region 資料與GridView繫結 gv_Bulk.DataSource = dt_Bulk; gv_Bulk.DataBind(); #endregion #region 檢查回傳資料 if (dt_Bulk.Rows.Count == 0) { this.ErrorMsgLabel.Text = "查無資料"; } #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }
/// <summary> /// 頁籤=通路繳款-支票 BUTTON 查詢 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Query_Click(object sender, EventArgs e) { try { #region 傳入參數 #region 設定[暫不月結註記] string str_UnMonthClose = string.Empty; if (this.ddl_UN_MONTH_CLOSE.SelectedValue == "ALL") { str_UnMonthClose = string.Empty; } else { str_UnMonthClose = this.ddl_UN_MONTH_CLOSE.SelectedValue; } #endregion #region 設定[已兌現] string str_ExDueFlg = string.Empty; if (this.ddl_EX_DUE_FLG.SelectedValue == "ALL") { str_ExDueFlg = string.Empty; } else { str_ExDueFlg = this.ddl_EX_DUE_FLG.SelectedValue; } #endregion BCO.CAACommon CAAComm = new BCO.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_RowCountLimit.Text, "int", false)); ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_NO.Text, "string", this.chb_LikeSearch.Checked)); //V_BOND_NO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_SAL_ID.Text, "string", this.chb_LikeSearch.Checked)); //V_SAL_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_Z_O.Text, "string", this.chb_LikeSearch.Checked)); //V_Z_O ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_STORE_ID.Text, "string", this.chb_LikeSearch.Checked)); //V_STORE_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_RFNO.Text, "string", this.chb_LikeSearch.Checked)); //V_RFNO ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_BOND_ID.Text, "string", this.chb_LikeSearch.Checked)); //V_BOND_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_BOND_TYPE.Text, "string", false)); //V_BOND_TYPE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_ACCEPT_BOND_DATE.StartDate, "string", false)); //V_ACCEPT_BOND_DATE_S ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_ACCEPT_BOND_DATE.EndDate, "string", false)); //V_ACCEPT_BOND_DATE_E ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_DUE_DATE.StartDate, "string", false)); //V_DUE_DATE_S ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_DUE_DATE.EndDate, "string", false)); //V_DUE_DATE_E ParameterList.Add(GetValueSetOP(this.slp_BOND_AMT.Operator)); //V_BOND_AMT_OP ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_BOND_AMT.Text, "int", false)); //N_BOND_AMT ParameterList.Add(GetValueSetOP(this.slp_POSTAGE.Operator)); //V_POSTAGE_OP ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_POSTAGE.Text, "int", false)); //N_POSTAGE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_PAY_BANK.Text, "string", this.chb_LikeSearch.Checked)); //V_PAY_BANK ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_PAY_ACCOUNT.Text, "string", this.chb_LikeSearch.Checked)); //V_PAY_ACCOUNT ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_COLL_BANK.Text, "string", this.chb_LikeSearch.Checked)); //V_COLL_BANK ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_COLL_ID.Text, "string", this.chb_LikeSearch.Checked)); //V_COLL_ID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_NB_COLL_DATE.StartDate, "string", false)); //V_NB_COLL_DATE_S ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_NB_COLL_DATE.EndDate, "string", false)); //V_NB_COLL_DATE_E ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_tab1_EX_DUE_DATE.StartDate, "date", false)); //票據預計兌現日起 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_tab1_EX_DUE_DATE.EndDate, "date", false)); //票據預計兌現日迄 ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_MEMO.Text, "string", this.chb_LikeSearch.Checked)); //V_MEMO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_REJECT_DATE.StartDate, "string", false)); //V_REJECT_DATE_S ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_REJECT_DATE.EndDate, "string", false)); //V_REJECT_DATE_E ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_REJECT_MEMO.Text, "string", this.chb_LikeSearch.Checked)); //V_REJECT_MEMO ParameterList.Add(CAAComm.GetValueSetParameter(str_UnMonthClose, "string", false)); //V_UN_MONTH_CLOSE ParameterList.Add(CAAComm.GetValueSetParameter(str_ExDueFlg, "string", false)); //V_EX_DUE_FLG ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_CREATEDATE.Text, "string", this.chb_LikeSearch.Checked)); //V_CREATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_CREATEUID.Text, "string", this.chb_LikeSearch.Checked)); //V_CREATEUID ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_UPDATEDATE.Text, "string", this.chb_LikeSearch.Checked)); //V_UPDATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_UPDATEUID.Text, "string", this.chb_LikeSearch.Checked)); //V_UPDATEUID ParameterList.Add(GetValueSetOP(this.slp_REMAIN_AMT.Operator)); //V_REMAIN_AMT_OP ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_REMAIN_AMT.Text, "int", false)); //N_REMAIN_AMT #endregion #region 連結資料庫 DataTable dt = new DataTable(); BCO.MaintainBondRecord bco = new BCO.MaintainBondRecord(ConntionDB); dt = bco.QueryByLike(ParameterList, null); #endregion #region 資料與GridView繫結 //抓取本頁初次登記的時間 string SessionIDName = "CAA121_Bond_" + PageTimeStamp.Value; Session["SessionID"] = SessionIDName; Session[SessionIDName] = dt; gv_Bond.DataSource = dt; gv_Bond.PageSize = (txt_Pagesize.Text == "") ? 10 : (int.Parse(txt_Pagesize.Text) < 0) ? 10 : int.Parse(txt_Pagesize.Text); gv_Bond.PageIndex = 0; gv_Bond.DataBind(); #endregion #region 將Key值存到Session中 ArrayList arl_Key = new ArrayList(); foreach (DataRow drRow in dt.Rows) { arl_Key.Add(drRow["BOND_NO"].ToString()); } Session["CAA122_SortKey" + this.PageTimeStamp.Value] = arl_Key; #endregion #region 檢查回傳資料 if (dt.Rows.Count == 0) { this.ErrorMsgLabel.Text = "查無資料"; } #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }