protected void gv_QueryLock_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Delte_VDS_CAA_CONTROL_CHK") { #region 傳入參數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//登入人員 #endregion #region 連結資料庫 BCO.RecordingCloseLockInfo bco = new BCO.RecordingCloseLockInfo(ConntionDB); bco.DELETE_LOCK_DATA(null, ParameterList); #endregion #region 如果解除成功 this.gv_QueryLock.DataSource = null; this.gv_QueryLock.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_TAB4_Open_Click(object sender, EventArgs e) { try { #region 檢查條件 BCO.CAACommon CAAComm = new BCO.CAACommon(); ArrayList arl_Check_Condition = Check_Condition("TAB 月結"); #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), "CAA181", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion #region 傳入參數 string s_Now = DateTime.Now.ToString(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter("CAA18", "string", false));//月結功能代碼 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_4_CLOSE_MONTH.Text, "string", false));//月結年月 ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//更新人員 ParameterList.Add(CAAComm.GetValueSetParameter(s_Now, "datetime", false));//更新日期 #endregion #region 連結資料庫 BCO.RecordingCloseLockInfo bco = new BCO.RecordingCloseLockInfo(ConntionDB); ArrayList ary_Result = bco.RecordingByOpen(ParameterList, null, ConntionDB); #endregion #region 檢查回傳資料 this.ErrorMsgLabel.Text = ary_Result[1].ToString(); #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } finally { Finally_Function(); } }
/// <summary> /// Button [解除]鈕 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void but_Query_Lock_Click(object sender, EventArgs e) { try { #region 傳入參數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false));//登入人員 #endregion #region 連結資料庫 DataTable dt_Return = new DataTable(); BCO.RecordingCloseLockInfo bco = new BCO.RecordingCloseLockInfo(ConntionDB); dt_Return = bco.QUERY_LOCK_DATA(ParameterList); #endregion #region 資料與GridView繫結 this.gv_QueryLock.DataSource = dt_Return; this.gv_QueryLock.PageIndex = 0; this.gv_QueryLock.DataBind(); #endregion #region 檢查回傳資料 if (dt_Return.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 but_Query_Click(object sender, EventArgs e) { try { #region 檢查條件 BCO.CAACommon CAAComm = new BCO.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 設定GridView this.gv_QueryResult.DataSource = null; this.gv_QueryResult.DataBind(); #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), "CAA281", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion #region 傳入參數 #region 處理時間Between欄位要傳給DataBase的值 string s_UPDATEDATE_B = string.Empty; string s_UPDATEDATE_E = string.Empty; if (this.slp_UPDATEDATE.StartDate == string.Empty) { s_UPDATEDATE_B = string.Empty; } else { s_UPDATEDATE_B = this.slp_UPDATEDATE.StartDate + " 00:00:00"; } if (this.slp_UPDATEDATE.EndDate == string.Empty) { s_UPDATEDATE_E = string.Empty; } else { s_UPDATEDATE_E = this.slp_UPDATEDATE.EndDate + " 23:59:59"; } #endregion ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_FUNC_NO_B.Text, "string", false));//[功能號]起 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_FUNC_NO_E.Text, "string", false));//[功能號]迄 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_MONTH_CLOSE_B.Text, "string", false));//[月結月份]起 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_MONTH_CLOSE_E.Text, "string", false));//[月結月份]迄 ParameterList.Add(CAAComm.GetValueSetParameter(s_UPDATEDATE_B, "datetime", false));//[維護日期]起 ParameterList.Add(CAAComm.GetValueSetParameter(s_UPDATEDATE_E, "datetime", false));//[維護日期]迄 ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_UPDATEUID.Text, "string", this.chb_LikeSearch.Checked));//[維護人員] ParameterList.Add(CAAComm.GetValueSetParameter((this.txt_RowCountLimit.Text == string.Empty) ? "100" : (int.Parse(this.txt_RowCountLimit.Text) < 0) ? "100" : this.txt_RowCountLimit.Text, "int", false));//[筆數] ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); #endregion #region 連結資料庫 DataTable dt_Return = new DataTable(); BCO.RecordingCloseLockInfo bco = new BCO.RecordingCloseLockInfo(ConntionDB); dt_Return = bco.QueryMonClosebyLike(ParameterList); #endregion #region 資料與GridView繫結 //抓取本頁初次登記的時間 string SessionIDName = "CAA281_" + PageTimeStamp.Value; Session["SessionID"] = SessionIDName; Session[SessionIDName] = dt_Return; this.gv_QueryResult.DataSource = dt_Return; this.gv_QueryResult.PageSize = (this.txt_Pagesize.Text == string.Empty) ? 20 : (int.Parse(this.txt_Pagesize.Text) < 0) ? 20 : int.Parse(this.txt_Pagesize.Text); this.gv_QueryResult.PageIndex = 0; this.gv_QueryResult.DataBind(); #endregion #region 檢查回傳資料 if (dt_Return.Rows.Count == 0) { this.ErrorMsgLabel.Text = "查無資料"; } #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }
/// <summary> /// 頁籤=月結處理 BUTTON 月結 /// </summary> protected void btn_Close_Click(object sender, EventArgs e) { try { #region 檢查條件 BCO.CAACommon CAAComm = new BCO.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(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(CAAComm.GetValueSetParameter("CAA12", "string", false)); //V_FUNC_NO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_YearMonth.Text, "string", false)); //V_MONTH_CLOSE ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_CREATEUID ParameterList.Add(CAAComm.GetValueSetParameter(s_Now, "datetime", false)); //D_CREATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_UPDATEUID ParameterList.Add(CAAComm.GetValueSetParameter(s_Now, "datetime", false)); //D_UPDATEDATE #endregion #region 連結資料庫 BCO.RecordingCloseLockInfo bco = new BCO.RecordingCloseLockInfo(ConntionDB); ArrayList ary_Result = bco.RecordingByClose(ParameterList, null, ConntionDB); #endregion #region 檢查回傳資料 this.ErrorMsgLabel.Text = ary_Result[1].ToString(); #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } }
private string Exec_UnCloseMonth(string strYearMonth) { CAAModel.RecordingCloseLockInfo BCO = new CAAModel.RecordingCloseLockInfo(ConntionDB); ParameterList.Clear(); ParameterList.Add("CAA11"); ParameterList.Add(strYearMonth); ParameterList.Add(Session["UID"].ToString()); ParameterList.Add(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")); ArrayList arr = BCO.RecordingByOpen(ParameterList, null, ConntionDB); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "alert('" + arr[1].ToString() + "');", true); return arr[0].ToString(); }
/// <summary> /// Button 解除月結動作 /// </summary> protected void btnOpen_Click(object sender, EventArgs e) { if (this.slp_YearMonth1.Text.Trim() != "") { try { CAAModel.RecordingCloseLockInfo BCO = new CAAModel.RecordingCloseLockInfo(ConntionDB); string strNowDate = DateTime.Now.ToString(); CAAModel.CAACommon CAAComm = new CAAModel.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter("CAA15", "string", false)); //V_FUNC_NO ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_YearMonth1.Text.Trim(), "string", false)); //V_MONTH_CLOSE ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_UPDATEUID ParameterList.Add(CAAComm.GetValueSetParameter(strNowDate, "datetime", false)); //D_UPDATEDATE ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_UPDATEUID ParameterList.Add(CAAComm.GetValueSetParameter(strNowDate, "datetime", false)); //D_UPDATEDATE ArrayList ary = BCO.InvoiceByOpen(ParameterList, null, ConntionDB); this.ErrorMsgLabel.Text = ary[1].ToString(); } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } } else { this.ErrorMsgLabel.Text = "月結月份不可為空值!"; } }