/// <summary> /// CRM07_1 /// </summary> /// <param name="Parameter">變數集</param> /// <param name="Dt">回傳結果</param> /// <returns>回傳成功失敗</returns> public bool CRM07_1(ArrayList ParameterList, ref DataTable Dt ) { bool Result = false; try { CRMModel.MaintainCRMOrderTransfer bco = new CRMModel.MaintainCRMOrderTransfer(ConntionDB); Dt = bco.ProcessCreateCRMOrderTransfer3(ParameterList, null); Result = true; } catch (Exception ex) { throw ex; } return Result; }
/// <summary> /// UP BUTTON 存檔鈕 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void but_up_Save_Click(object sender, EventArgs e) { try { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Remove(0, sb.Length); #region 檢查所有必填欄位是否為空值 if (this.slp_up_CHAN_NO.Text.Trim() == string.Empty) { sb.Append("[通路]欄位為必填欄位\\r\\n"); } if (this.slp_up_STORE.Text.Trim() == string.Empty) { sb.Append("[門市]欄位為必填欄位\\r\\n"); } if (this.slp_up_Z_O.Text.Trim() == string.Empty) { sb.Append("[營業所]欄位為必填欄位\\r\\n"); } if (this.slp_up_BUSDATE.Text.Trim() == string.Empty) { sb.Append("[訂單日期]欄位為必填欄位\\r\\n"); } if (this.slp_up_SALE_ID.Text.Trim() == string.Empty) { sb.Append("[營業人員]欄位為必填欄位\\r\\n"); } if (this.slp_up_BUSUID.Text.Trim() == string.Empty) { sb.Append("[訂單維護者]欄位為必填欄位\\r\\n"); } if (this.drop_up_ORDER_TYPE.Text == string.Empty) { sb.Append("[訂單來源]欄位為必填欄位\\r\\n"); } if (this.txt_up_CODE.Text.Trim() == string.Empty) { sb.Append("[訂單編號]欄位為必填欄位\\r\\n"); } //if (this.txt_up_CRM_NO.Text.Trim() == string.Empty) //{ sb.Append("[流水編號]欄位為必填欄位\\r\\n"); } if (GetStringLen(txt_up_PO_SOURCE_NO.Text.Trim()) > 20) { sb.Append("[PO單號預設]欄位輸入資料長度過長\\r\\n"); } if (sb.ToString() != string.Empty) { ScriptManager.RegisterStartupScript(this.up_Up_Button, typeof(UpdatePanel), "CRM041", "alert('" + sb.ToString() + "');", true); return; } #endregion #region 檢查是否有明細資料 int i_dt_Detail_Count = 0; if (dt_Detail != null) { if (dt_Detail.GetChanges(DataRowState.Deleted) == null) { i_dt_Detail_Count = dt_Detail.Rows.Count; } else { i_dt_Detail_Count = dt_Detail.Rows.Count - dt_Detail.GetChanges(DataRowState.Deleted).Rows.Count; } } if (dt_Detail == null || i_dt_Detail_Count == 0) { sb.Append("無明細資料"); } if (sb.ToString() != string.Empty) { ScriptManager.RegisterStartupScript(this.up_Up_Button, typeof(UpdatePanel), "CRM041", "alert('" + sb.ToString() + "');", true); return; } #endregion int i_Id = 0; BCO.RecordCRMOrder bco = new BCO.RecordCRMOrder(ConntionDB); ArrayList ParameterList = new ArrayList();//20091117 if (this.hid_PageStatus.Value == "INSERT") { #region 儲存新增資料 DateTime d_Now = DateTime.Now; ParameterList.Clear(); ParameterList.Add(GetValueSetParameter(this.slp_up_BUSDATE.Text, "date"));//訂單日期 ParameterList.Add(GetValueSetParameter(this.slp_up_BUSUID.Text, "string"));//訂單維護者 ParameterList.Add(d_Now);//CREATEDATE ParameterList.Add(Session["UID"].ToString());//CREATEUID ParameterList.Add(d_Now);//UPDATEDATE ParameterList.Add(Session["UID"].ToString());//UPDATEUID ParameterList.Add(25);//結案狀態(Status)=25(未結案) ParameterList.Add(1);//ENABLE ParameterList.Add(GetValueSetParameter(this.txt_up_CRM_NO.Text, "string"));//流水編號 ParameterList.Add(GetValueSetParameter(this.slp_up_CHAN_NO.Text, "string"));//通路 ParameterList.Add(GetValueSetParameter(this.slp_up_STORE.Text, "string"));//門市 ParameterList.Add(System.DBNull.Value);//CLOSE_DATE ParameterList.Add(GetValueSetParameter(this.txt_up_PO_SOURCE_NO.Text, "string"));//PO單號預設 ParameterList.Add(GetValueSetParameter(this.drop_up_ORDER_TYPE.Text, "int"));//訂單來源 ParameterList.Add(Session["UID"].ToString());//建立單位(Create_Role)= [@登入者]所屬角色 ParameterList.Add(Session["UID"].ToString()); i_Id = bco.CreateCRMOrder(ParameterList, null, dt_Detail); #endregion } else if (this.hid_PageStatus.Value == "EDIT") { i_Id = int.Parse(dt_Master.Rows[0]["ID"].ToString()); #region 取得異動資料 DataTable dt_Detail_Changes_Delete = new DataTable(); DataTable dt_Detail_Changes_Add = new DataTable(); DataTable dt_Detail_Changes_Modify = new DataTable(); dt_Detail_Changes_Delete = dt_Detail.GetChanges(DataRowState.Deleted); dt_Detail_Changes_Add = dt_Detail.GetChanges(DataRowState.Added); dt_Detail_Changes_Modify = dt_Detail.GetChanges(DataRowState.Modified); #endregion #region 將異動資料寫入資料庫 ParameterList.Clear(); ParameterList.Add(Session["UID"].ToString()); ParameterList.Add(DateTime.Now); ParameterList.Add(i_Id); bco.UpdateCRMOrder(ParameterList, null, dt_Detail_Changes_Delete, dt_Detail_Changes_Add, dt_Detail_Changes_Modify, dt_Detail_Original); #endregion } #region 清空靜態變數 // dtChainPOSetting = null;//異動欄位[門市] dtStock = null;//異動欄位[期別] s_PMA = string.Empty;//大分類(異動欄位[品號/品名]) s_ROOT_NO = string.Empty;//群分類(異動欄位[品號/品名]) s_SRC_LOCATE_TYPE = string.Empty;//建議儲區類別(異動欄位[訂貨量]) dt_Detail = null; //Session["CRM041_dt_Detail" + PageTimeStamp.Value] = null; dt_Master = null; dt_Detail_Original = null; #endregion #region 重新從資料庫抓取資料 DataSet ds_Return = new DataSet(); ParameterList.Clear(); ParameterList.Add(i_Id); ParameterList.Add(Session["UID"].ToString()); ds_Return = bco.QUERY_CRM041_MAIN_AND_DETL(ParameterList); dt_Master = ds_Return.Tables["VDS_CRM_ORDER_MAIN"].Copy(); dt_Detail = ds_Return.Tables["VDS_CRM_ORDER_DETL"].Copy(); //Session["CRM041_dt_Detail" + PageTimeStamp.Value] = dt_Detail; dt_Detail_Original = ds_Return.Tables["VDS_CRM_ORDER_DETL"].Copy(); ds_Return.Clear(); ds_Return.Dispose(); #endregion #region 檢查今日該門市是否已有訂單擷轉記錄 if (this.hid_PageStatus.Value == "INSERT") { ParameterList.Clear(); ParameterList.Add(GetValueSetParameter(this.slp_up_BUSDATE.Text, "date"));//訂單擷轉日(放系統日) ParameterList.Add(GetValueSetParameter(this.slp_up_CHAN_NO.Text, "string"));//通路 ParameterList.Add(GetValueSetParameter(this.slp_up_STORE.Text, "string"));//門市 ParameterList.Add(Session["UID"].ToString()); BCO.MaintainCRMOrderTransfer bco_Transfer = new BCO.MaintainCRMOrderTransfer(ConntionDB); if (bco_Transfer.QueryCountsByStore(ParameterList) > 0) { sb.Append("當天訂單已結轉,到店時間將會延後"); ScriptManager.RegisterStartupScript(this.up_Up_Button, typeof(UpdatePanel), "CRM041", "alert('" + sb.ToString() + "');", true); } } #endregion #region 寫入訊息 if (this.hid_PageStatus.Value == "INSERT") { this.RightMsgLabel.Text = "新增成功"; } else if (this.hid_PageStatus.Value == "EDIT") { this.RightMsgLabel.Text = "修改儲存成功"; } #endregion #region 新增後處理 this.hid_PageStatus.Value = "VIEW"; this.txt_PageStatus.Text = "VIEW"; SetPageStatus(); #endregion #region 將資料寫入頁面 #region MAIN this.slp_up_CHAN_NO.Text = dt_Master.Rows[0]["CHAN_NO"].ToString();//通路 this.slp_up_STORE.Text = dt_Master.Rows[0]["STORE"].ToString();//門市 this.slp_up_Z_O.Text = dt_Master.Rows[0]["Z_O"].ToString();//營業所 this.slp_up_BUSDATE.Text = dt_Master.Rows[0]["BUSDATE"].ToString();//訂單日期 this.slp_up_SALE_ID.Text = dt_Master.Rows[0]["SAL_ID"].ToString();//營業人員 this.slp_up_BUSUID.Text = dt_Master.Rows[0]["BUSUID"].ToString();//訂單維護者 this.drop_up_ORDER_TYPE.Text = dt_Master.Rows[0]["ORDER_TYPE"].ToString();//訂單來源 this.txt_up_PO_SOURCE_NO.Text = dt_Master.Rows[0]["PO_SOURCE_NO"].ToString();//PO單號預設 this.txt_up_CODE.Text = dt_Master.Rows[0]["CODE"].ToString();//訂單編號 this.txt_up_CRM_NO.Text = dt_Master.Rows[0]["CRM_NO"].ToString();//流水編號 //記錄靜態變數 門市、通路 s_CHAN_NO = this.slp_up_CHAN_NO.Text; s_STORE = this.slp_up_STORE.Text; #endregion #region DETL this.gv_Detail.DataSource = dt_Detail; this.gv_Detail.PageSize = 10; this.gv_Detail.PageIndex = 0; this.gv_Detail.DataBind(); Panel1.Height = gv_Detail.Rows.Count * 45 + 60; #endregion #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } finally { } }
protected void gv_Main_Query_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Query_Detl") { #region 傳入參數 string s_TRANS_DATE = string.Empty; string s_ST_ACCEPT_DATE = string.Empty; string s_ROOT_NO = string.Empty; string s_TRANS_NO = string.Empty; int i_GridView_Index = int.Parse(e.CommandArgument.ToString()); GridViewRow gv_CommandRow = ((GridView)sender).Rows[i_GridView_Index]; s_TRANS_DATE = gv_CommandRow.Cells[0].Text.Replace(" ", "").Trim();//擷轉處理日 s_ST_ACCEPT_DATE = gv_CommandRow.Cells[1].Text.Replace(" ", "").Trim();//進貨日 s_ROOT_NO = gv_CommandRow.Cells[2].Text.Trim();//群分類 s_TRANS_NO = gv_CommandRow.Cells[4].Text.Trim();//訂單擷轉序號 ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); if (s_TRANS_DATE != "") ParameterList.Add(GetValueSetParameter(s_TRANS_DATE, "date", false)); else ParameterList.Add(DBNull.Value); if (s_ST_ACCEPT_DATE != "") ParameterList.Add(GetValueSetParameter(s_ST_ACCEPT_DATE, "date", false)); else ParameterList.Add(DBNull.Value); ParameterList.Add(GetValueSetParameter(s_ROOT_NO, "string", false)); ParameterList.Add(GetValueSetParameter(s_TRANS_NO, "string", false)); ParameterList.Add(Session["UID"].ToString()); #endregion #region 取得資料 DataTable dt_Return = new DataTable(); BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); dt_Return = bco.QueryDtlByFind(ParameterList); #endregion #region 資料與GridView繫結 //抓取本頁初次登記的時間 string SessionIDName = "CRM181_gv_Detl_Query" + PageTimeStamp.Value; Session["SessionID"] = SessionIDName; Session[SessionIDName] = dt_Return; this.gv_Detl_Query.DataSource = dt_Return; this.gv_Detl_Query.PageSize = 5; this.gv_Detl_Query.PageIndex = 0; this.gv_Detl_Query.DataBind(); #endregion #region 檢查是否有資料 string s_ScriptManager_Script = string.Empty; if (dt_Return.Rows.Count == 0) { this.ErrorMsgLabel.Text = "查無資料"; s_ScriptManager_Script = "document.getElementById('" + this.panel_Detl_Query.ClientID + "').style.display = 'none';"; } else { s_ScriptManager_Script = "document.getElementById('" + this.panel_Detl_Query.ClientID + "').style.display = 'block';"; } ScriptManager.RegisterStartupScript(this.up_Detl_Query, typeof(UpdatePanel), "CRM181", s_ScriptManager_Script, true); #endregion } } catch (Exception ex) { this.ErrorMsgLabel.Text = ex.Message; } finally { } }
/// <summary> /// BUTTON [查詢]鈕 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void but_Query_Click(object sender, EventArgs e) { try { #region 檢查條件 string s_CheckPage = CheckPage(); if (s_CheckPage != string.Empty) { this.ErrorMsgLabel.Text = s_CheckPage; return; } #endregion #region 傳入參數 ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(GetValueSetParameter(this.slp_TRANS_DATE.Text, "date", false)); ParameterList.Add(GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "date", false)); ParameterList.Add(slp_ROOT_NO.Text);//GetValueSetParameter(this.slp_ROOT_NO.Text, "string", true) ParameterList.Add(Session["UID"].ToString()); #endregion #region 取得資料 DataTable dt_Return = new DataTable(); BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); dt_Return = bco.QueryCRMOrderTransferByFind(ParameterList); #endregion #region 資料與GridView繫結 //抓取本頁初次登記的時間 string SessionIDName = "CRM181_gv_Main_Query" + PageTimeStamp.Value; Session["SessionID"] = SessionIDName; Session[SessionIDName] = dt_Return; this.gv_Main_Query.DataSource = dt_Return; this.gv_Main_Query.DataBind(); #endregion #region 檢查是否有資料 if (dt_Return.Rows.Count == 0) { this.ErrorMsgLabel.Text = "查無資料"; } string s_ScriptManager_Script = string.Empty; s_ScriptManager_Script = @" document.getElementById('" + this.panel_Main_Query.ClientID + @"').style.display = 'block'; document.getElementById('" + this.panel_Detl_Query.ClientID + @"').style.display = 'none';"; ScriptManager.RegisterStartupScript(this.up_Main_Query, typeof(UpdatePanel), "CRM181", s_ScriptManager_Script, true); #endregion } catch (Exception ex) { this.ErrorMsgLabel.Text = ex.ToString(); } finally { } }
/// <summary> /// BUTTON [執行擷轉]鈕 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> //protected void but_Execute_Click() protected void but_Execute_Click(object sender, EventArgs e) { #region if (this.ErrorMsgLabel.Text != "") { return; } #endregion ArrayList arl_Return = new ArrayList(); DataTable Dt = null; string s_ErrorMsg = ""; BCO.CRMCommon CRMComm = new BCO.CRMCommon(); #region 建立暫存表格 //DataTable dt_Parameter = new DataTable(); //DataColumn dc_Parameter_TRANS_DATE = new DataColumn("TRANS_DATE", System.Type.GetType("System.String")); //DataColumn dc_Parameter_ST_ACCEPT_DATE = new DataColumn("ST_ACCEPT_DATE", System.Type.GetType("System.String")); //DataColumn dc_Parameter_ROOT_NO = new DataColumn("ROOT_NO", System.Type.GetType("System.String")); //DataColumn dc_Parameter_USER_ID = new DataColumn("USER_ID", System.Type.GetType("System.String")); //DataColumn dc_Parameter_ID = new DataColumn("ID", System.Type.GetType("System.Int32")); //DataColumn dc_Parameter_PID = new DataColumn("PID", System.Type.GetType("System.Int32")); //dt_Parameter.Columns.Add(dc_Parameter_TRANS_DATE); //dt_Parameter.Columns.Add(dc_Parameter_ST_ACCEPT_DATE); //dt_Parameter.Columns.Add(dc_Parameter_ROOT_NO); //dt_Parameter.Columns.Add(dc_Parameter_USER_ID); //dt_Parameter.Columns.Add(dc_Parameter_ID); //dt_Parameter.Columns.Add(dc_Parameter_PID); #endregion try { #region 傳入參數 ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(slp_up_TRANS_DATE.Text); ParameterList.Add(slp_ST_ACCEPT_DATE.Text); ParameterList.Add(slp_ROOT_NO.Text); ParameterList.Add(Session["UID"].ToString()); ParameterList.Add(string.Format("{0}_{1}", PageTimeStamp.Value, Session["UID"].ToString())); //--------------------------------------------------------------------- #region oldest //foreach (GridViewRow gvRow in this.gv_WaitForWork.Rows) //{ // CheckBox chk_Sgl = (CheckBox)gvRow.FindControl("chk_Sgl"); // HiddenField hid_ID = (HiddenField)gvRow.FindControl("hid_ID"); // HiddenField hid_PID = (HiddenField)gvRow.FindControl("hid_PID"); // if (chk_Sgl.Checked == true) // { // DataRow dr_Parameter = dt_Parameter.NewRow(); // dr_Parameter["TRANS_DATE"] = CRMComm.GetValueSetParameter(this.slp_up_TRANS_DATE.Text, "string", false); // dr_Parameter["ST_ACCEPT_DATE"] = CRMComm.GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "string", false); // dr_Parameter["ROOT_NO"] = CRMComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false); // dr_Parameter["USER_ID"] = Session["UID"].ToString(); // dr_Parameter["ID"] = int.Parse(hid_ID.Value.Trim()); // dr_Parameter["PID"] = int.Parse(hid_PID.Value.Trim()); // dt_Parameter.Rows.Add(dr_Parameter); // } //} #endregion #region old //string SessionIDName = "CRM071_gv_WaitForWork" + PageTimeStamp.Value; //DataTable dtTemp = (DataTable)Session[SessionIDName]; //string s_Checked, s_ID, s_PID; //foreach (DataRow drTemp in dtTemp.Rows) //{ // s_Checked = drTemp["CHECKED"].ToString().Trim(); // s_ID = drTemp["ID"].ToString().Trim(); // s_PID = drTemp["PID"].ToString().Trim(); // if (s_Checked != "0")//表示未被設成【未勾選】 // { // DataRow dr_Parameter = dt_Parameter.NewRow(); // dr_Parameter["TRANS_DATE"] = CRMComm.GetValueSetParameter(this.slp_up_TRANS_DATE.Text, "string", false); // dr_Parameter["ST_ACCEPT_DATE"] = CRMComm.GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "string", false); // dr_Parameter["ROOT_NO"] = CRMComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false); // dr_Parameter["USER_ID"] = Session["UID"].ToString(); // dr_Parameter["ID"] = int.Parse(s_ID); // dr_Parameter["PID"] = int.Parse(s_PID); // dt_Parameter.Rows.Add(dr_Parameter); // } //} #endregion //if (dt_Parameter.Rows.Count == 0) //{ // this.ErrorMsgLabel.Text = "請選擇待擷轉品項"; // return; //} //--------------------------------------------------------------------- #endregion #region 連結資料庫 BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); //arl_Return = bco.ProcessCreateCRMOrderTransfer(ParameterList, dt_Parameter, null, out s_ErrorMsg); iTransferResult = 0; //arl_Return = bco.ProcessCreateCRMOrderTransfer3(ParameterList, null); Dt = bco.ProcessCreateCRMOrderTransfer3(ParameterList, null); #endregion } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; this.up_Msg.Update(); } finally { #region string s_ScriptManager_Script = string.Empty; if (arl_Return != null && arl_Return.Count > 0) { if (arl_Return[0].ToString() == "1") iTransferResult = 1; if (arl_Return[0].ToString() == "1" && arl_Return[1].ToString() == string.Empty)//代表處理成功 { #region TextBox txt_Handle_Count = (TextBox)this.slp_Handle_Count.FindControl("TextBoxCode"); txt_Handle_Count.Text = arl_Return[3].ToString(); txt_Handle_TRANS_NO.Text = arl_Return[2].ToString(); this.RightMsgLabel.Text = "執行擷轉成功,請按【檢視異常報表】查詢本次擷轉異常資料。"; this.up_Msg.Update(); if (this.slp_ROOT_NO.Text == "2") // 圖書時直接轉手開單,並做配本確認 { #region 圖書 string SessionIdName = "POP_QueryDisNo_" + PageTimeStamp.Value; Session[SessionIdName] = null; ParameterList.Clear(); ParameterList.Add(CRMComm.GetValueSetParameter(slp_ROOT_NO.Text, "string", false)); ParameterList.Add(CRMComm.GetValueSetParameter(slp_up_TRANS_DATE.Text, "string", false)); ParameterList.Add(CRMComm.GetValueSetParameter(slp_ST_ACCEPT_DATE.Text, "string", false)); ParameterList.Add(CRMComm.GetValueSetParameter("", "string", false)); //0代表未逾期客訂,1代表是逾期客訂 ParameterList.Add(CRMComm.GetValueSetParameter(arl_Return[2].ToString().Trim(), "string", false));//擷轉序號起 ParameterList.Add(CRMComm.GetValueSetParameter(arl_Return[2].ToString().Trim(), "string", false));//擷轉序號迄 ParameterList.Add(Session["UID"].ToString()); Session[SessionIdName] = ParameterList; s_ScriptManager_Script += "$get('" + txt_Handle_TRANS_NO.ClientID + "').value = '" + arl_Return[2].ToString() + @"';" + "$get('" + txt_Handle_Count.ClientID + "').value = '" + arl_Return[3].ToString() + @"';"; s_ScriptManager_Script += "alert('圖書擷轉手開單產生成功!');"; s_ScriptManager_Script += string.Format(@"POP_QueryDisNo('{0}','{1}','{2}','{3}','{4}','{5}');", slp_ROOT_NO.Text, slp_up_TRANS_DATE.Text, slp_ST_ACCEPT_DATE.Text, "0", //非逾期 arl_Return[2].ToString(),//擷轉序號起=擷轉序號迄 arl_Return[2].ToString()); ScriptManager.RegisterStartupScript(this.up_Execute, typeof(UpdatePanel), "CRM071", s_ScriptManager_Script, true); #endregion } else { #region 雜誌 s_ScriptManager_Script += "$get('" + txt_Handle_TRANS_NO.ClientID + "').value = '" + arl_Return[2].ToString() + @"';" + "$get('" + txt_Handle_Count.ClientID + "').value = '" + arl_Return[3].ToString() + @"';"; ScriptManager.RegisterStartupScript(this.up_Execute, typeof(UpdatePanel), "CRM071", s_ScriptManager_Script, true); #endregion } #endregion } else { this.ErrorMsgLabel.Text = "執行擷轉有異常:" + arl_Return[1].ToString(); this.up_Msg.Update(); } } else { //this.ErrorMsgLabel.Text = "無法建立擷轉資料,執行擷轉發生異常"; if (s_ErrorMsg != "") { this.ErrorMsgLabel.Text = s_ErrorMsg; } else { this.ErrorMsgLabel.Text = "執行擷轉失敗!"; } this.up_Msg.Update(); } CRMComm = null; //ScriptManager.RegisterStartupScript(this.up_Execute, typeof(UpdatePanel), "CRM071", "but_Execute_End();" + s_ScriptManager_Script, true); #endregion } }
/// <summary> /// 取得商品儲區擷轉明細 /// </summary> private DataTable Get_Trans_Detl_Data(string s_TRANS_DATE, int i_PageSize, int i_PageIndex) { #region 傳入參數 BCO.CRMCommon CRMComm = new BCO.CRMCommon(); ArrayList ParameterList = new ArrayList();//20091117 ParameterList.Clear(); ParameterList.Add(CRMComm.GetValueSetParameter(s_TRANS_DATE, "date", false)); ParameterList.Add(Session["UID"].ToString()); ParameterList.Add(GetValueSetParameter(this.TextBoxRowCountLimit.Text.Trim(), "int", false)); #endregion #region 取得資料 DataTable dt_Return = new DataTable(); BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); dt_Return = bco.QueryCRMStockTransfer(ParameterList); #endregion #region 資料與GridView繫結 //抓取本頁初次登記的時間 string SessionIDName = "CRM071_gv_Item_Detl" + PageTimeStamp.Value; DataView dv_Return = new DataView(dt_Return); if (ViewState["SortField_gv_Item_Detl"] != null && ViewState["SortDirect_gv_Item_Detl"] != null) { dv_Return.Sort = ViewState["SortField_gv_Item_Detl"].ToString() + ViewState["SortDirect_gv_Item_Detl"].ToString(); } Session["SessionID"] = SessionIDName; Session[SessionIDName] = dt_Return; this.gv_Item_Detl.DataSource = dv_Return; this.gv_Item_Detl.PageSize = i_PageSize; this.gv_Item_Detl.PageIndex = i_PageIndex; this.gv_Item_Detl.DataBind(); #endregion return dt_Return; }
protected void but_CheckDup_Click(object sender, EventArgs e) { string Err; if (slp_ROOT_NO.Text == "1") { ErrorMsgLabel.Text ="雜誌無檢核功能!"; up_Msg.Update(); return; } BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); BCO.CRMCommon CRMComm = new BCO.CRMCommon(); ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(CRMComm.GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "date", false)); ParameterList.Add(CRMComm.GetValueSetParameter(this.slp_ROOT_NO.Text, "string", false)); bco.CheckDup(ParameterList,out Err); if (Err != string.Empty) { ErrorMsgLabel.Text = Err; } else { ErrorMsgLabel.Text = "查無重複品項"; } up_Msg.Update(); }
protected void btn_ClearAbnormal_Click(object sender, EventArgs e) { #region try { BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(slp_ROOT_NO.Text.Trim()); ParameterList.Add(Session["UID"].ToString()); bco.CLEAR_PROCESS_FLAG(ParameterList, null); RightMsgLabel.Text = "清除前次擷轉異常狀態成功"; } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } up_Msg.Update(); #endregion }
public static string CRM07AJAXCheckWithSameItem(string TransDate, string STAcceptDate, string RootNo, string UID ) { string ReturnStr = ""; ArrayList ParameterList = new ArrayList(); ParameterList.Add(TransDate); ParameterList.Add(STAcceptDate); ParameterList.Add(RootNo); ParameterList.Add(UID); BCO.MaintainCRMOrderTransfer bco = new BCO.MaintainCRMOrderTransfer(ConntionDB); bool Result = bco.CRM07CheckWithSameItem(ParameterList, null); ReturnStr = (Result) ? "Y":"N"; return ReturnStr; }