/// <summary> /// 初始檢視&編輯模式 /// </summary> private void Page_Status_VIEW_EDIT_LOAD() { if (this.hid_Page_Status.Value == "VIEW" || this.hid_Page_Status.Value == "EDIT") { #region 清空所有欄位 this.slp_SAL_DATE.Text = string.Empty;//營業日期 this.txt_COLL_DATE.Text = string.Empty;//交易日期 this.txt_COLL_TIME.Text = string.Empty;//交易時間 this.txt_COLL_SEQNO.Text = string.Empty;//交易序號 this.txt_COLL_AMT.Text = string.Empty;//交易金額 this.txt_REMAIN_AMT.Text = string.Empty;//沖帳餘額 this.slp_CHARGE.Text = string.Empty;//手續費 this.slp_STORE_ID.Text = string.Empty;//客戶編號 this.txt_PAY_CHKNO.Text = string.Empty;//繳款識別碼 this.slp_GROUP_NO.Text = string.Empty;//店群 this.txt_COLL_NO.Text = string.Empty;//收款單號 this.txt_MEMO.Text = string.Empty;//原因說明 #endregion #region 取得檢視資料 string strCode = string.Empty; try { if (Request["V_ID"] == null) { throw new Exception("載入頁面失敗!"); } else { strCode = Request["V_ID"].ToString(); } } catch { } ParameterList.Clear(); ParameterList.Add(strCode); //V_ID CAAModel.MaintainCollRecord BCO = new CAAModel.MaintainCollRecord(ConntionDB); dt = BCO.QueryCollRecordByFind(ParameterList); string s_RequestString = Request.QueryString["CAA102_Type"]; if (dt.Rows.Count != 1 && s_RequestString != "ToolBar") { throw new Exception("查無收款單號:" + strCode + "的相關資料"); } else if (dt.Rows.Count != 1 && s_RequestString == "ToolBar") { throw new Exception("查無此筆資料或已被其他使用者刪除,請點選上一筆/下一筆鈕或回查詢頁重新查詢!"); } #endregion #region 將資料寫入頁面 this.slp_SAL_DATE.Text = dt.Rows[0]["SAL_DATE"].ToString();//營業日期 this.txt_COLL_DATE.Text = dt.Rows[0]["COLL_DATE"].ToString();//交易日期/時間 this.txt_COLL_TIME.Text = dt.Rows[0]["COLL_TIME"].ToString(); this.txt_COLL_SEQNO.Text = dt.Rows[0]["COLL_SEQNO"].ToString();//交易序號 this.txt_COLL_AMT.Text = dt.Rows[0]["COLL_AMT"].ToString();//交易金額 this.txt_REMAIN_AMT.Text = dt.Rows[0]["COLL_REMAIN_AMT"].ToString();//沖帳餘額 this.slp_CHARGE.Text = dt.Rows[0]["CHARGE"].ToString();//手續費 this.slp_STORE_ID.Text = dt.Rows[0]["STORE_ID"].ToString();//客戶編號 this.txt_PAY_CHKNO.Text = dt.Rows[0]["PAY_CHKNO"].ToString();//繳款識別碼 this.slp_GROUP_NO.Text = dt.Rows[0]["GROUP_NO"].ToString();//店群 this.txt_COLL_NO.Text = dt.Rows[0]["COLL_NO"].ToString();//收款單號 this.txt_MEMO.Text = dt.Rows[0]["MEMO"].ToString();//收款單號 #endregion #region 設定ReadOnly #region 檢視模式 if (this.hid_Page_Status.Value == "VIEW") { this.slp_SAL_DATE.ReadOnly = true;//營業日期 this.txt_COLL_DATE.ReadOnly = true;//交易日期 this.txt_COLL_DATE.CssClass = "readtxtbox"; this.txt_COLL_TIME.ReadOnly = true;//交易時間 this.txt_COLL_TIME.CssClass = "readtxtbox"; this.txt_COLL_SEQNO.ReadOnly = true;//交易序號 this.txt_COLL_SEQNO.CssClass = "readtxtbox"; this.txt_COLL_AMT.ReadOnly = true;//交易金額 this.txt_COLL_AMT.CssClass = "readtxtbox"; this.txt_REMAIN_AMT.ReadOnly = true;//沖帳餘額 this.txt_REMAIN_AMT.CssClass = "readtxtbox"; this.slp_CHARGE.ReadOnly = true;//手續費 this.slp_STORE_ID.ReadOnly = true;//客戶編號 this.txt_PAY_CHKNO.ReadOnly = true;//繳款識別碼 this.txt_PAY_CHKNO.CssClass = "readtxtbox"; this.slp_GROUP_NO.ReadOnly = true;//店群 this.txt_COLL_NO.ReadOnly = true;//收款單號 this.txt_COLL_NO.CssClass = "readtxtbox"; this.txt_MEMO.ReadOnly = true;//原因說明 this.txt_MEMO.CssClass = "readtxtbox"; } #endregion #region 編輯模式 if (this.hid_Page_Status.Value == "EDIT") { if (OnlyEditMemo() == false) { this.txt_COLL_AMT.ReadOnly = true;//交易金額 this.txt_COLL_AMT.CssClass = "readtxtbox"; this.txt_COLL_NO.ReadOnly = true;//收款單號 this.txt_COLL_NO.CssClass = "readtxtbox"; this.slp_GROUP_NO.ReadOnly = true;//店群 this.txt_REMAIN_AMT.ReadOnly = true;//沖帳餘額 this.txt_REMAIN_AMT.CssClass = "readtxtbox"; } else { this.slp_SAL_DATE.ReadOnly = true;//營業日期 this.txt_COLL_DATE.ReadOnly = true;//交易日期 this.txt_COLL_DATE.CssClass = "readtxtbox"; this.txt_COLL_TIME.ReadOnly = true;//交易時間 this.txt_COLL_TIME.CssClass = "readtxtbox"; this.txt_COLL_SEQNO.ReadOnly = true;//交易序號 this.txt_COLL_SEQNO.CssClass = "readtxtbox"; this.txt_COLL_AMT.ReadOnly = true;//交易金額 this.txt_COLL_AMT.CssClass = "readtxtbox"; this.txt_REMAIN_AMT.ReadOnly = true;//沖帳餘額 this.txt_REMAIN_AMT.CssClass = "readtxtbox"; this.slp_CHARGE.ReadOnly = true;//手續費 this.slp_STORE_ID.ReadOnly = true;//客戶編號 this.txt_PAY_CHKNO.ReadOnly = true;//繳款識別碼 this.txt_PAY_CHKNO.CssClass = "readtxtbox"; this.slp_GROUP_NO.ReadOnly = true;//店群 this.txt_COLL_NO.ReadOnly = true;//收款單號 this.txt_COLL_NO.CssClass = "readtxtbox"; } } #endregion #endregion } }
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_ID"] == null) { throw new Exception("載入頁面失敗!"); } else { strCode = Request["V_ID"].ToString(); } } catch { } ParameterList.Clear(); ParameterList.Add(strCode); //V_ID CAAModel.MaintainCollRecord BCO = new CAAModel.MaintainCollRecord(ConntionDB); dt = BCO.QueryCollRecordByFind(ParameterList); if (dt.Rows[0]["COLL_REMAIN_AMT"].ToString() != dt.Rows[0]["CHK_REMAIN_AMT"].ToString()) bResult = true; } return bResult; }