} protected void but_down_Update_Click(object sender, EventArgs e) { this.ErrorMsgLabel.Text = ""; if (this.hid_PageStatus.Value == "INSERT") { this.EditFlagLabel.Text = ""; } else if (this.hid_PageStatus.Value == "EDIT") { this.EditFlagLabel.Text = "SHOW"; } bool boolFlag = true; String txt_down_STORE = this.slp_down_STORE.Text; String txt_down_STORE_NAME = this.slp_down_STORE.Name; String txt_down_ROUTE = this.txt_down_ROUTE.Value; String txt_down_STEP = this.txt_down_STEP.Value; String txt_down_CARTON_START_DATE = this.slp_down_CARTON_START_DATE.Text; String txt_down_CARTON_END_DATE = this.slp_down_CARTON_END_DATE.Text; String txt_down_BUSINESS_HOURS_START = this.slp_down_BUSINESS_HOURS_START.Text; String txt_down_BUSINESS_HOURS_END = this.slp_down_BUSINESS_HOURS_END.Text; String txt_down_UNION_START_DATE = this.slp_down_UNION_START_DATE.Text; String txt_down_UNION_END_DATE = this.slp_down_UNION_END_DATE.Text; String txt_dr_down_CARTON = this.dr_down_CARTON.Text; String txt_dr_down_UNION_SHIPPING = this.dr_down_UNION_SHIPPING.Text; //if (txt_down_CARTON_START_DATE.Trim() != "" && txt_down_CARTON_END_DATE.Trim() != "") //{ // int v = (txt_down_CARTON_START_DATE.Trim()).CompareTo(txt_down_CARTON_END_DATE.Trim()); // if (v > 0) // { // boolFlag = false; // ShowErrorMessage("[紙箱開始日]應小於[紙箱結束日]"); // } //} //if (txt_down_BUSINESS_HOURS_START.Trim() != "" && txt_down_BUSINESS_HOURS_END.Trim() != "") //{ // int v = (txt_down_BUSINESS_HOURS_START.Trim()).CompareTo(txt_down_BUSINESS_HOURS_END.Trim()); // if (v > 0) // { // boolFlag = false; // ShowErrorMessage("[營業時間起]應小於[營業時間迄]"); // } //} //if (txt_down_UNION_START_DATE.Trim() != "" && txt_down_UNION_END_DATE.Trim() != "") //{ // int v = (txt_down_UNION_START_DATE.Trim()).CompareTo(txt_down_UNION_END_DATE.Trim()); // if (v > 0) // { // boolFlag = false; // ShowErrorMessage("[共配開始日]應小於[共配結束日]"); // } //} if (boolFlag) { if ((this.hid_PageStatus.Value == "INSERT" || this.hid_PageStatus.Value == "EDIT") && this.hid_ID.Value == string.Empty) { #region 新增狀態,若是第一筆資料,建立 TEMP TABLE if (this.hid_PageStatus.Value == "INSERT" ) { if (dt_Detail == null) { BCO.MaintainTransSpecStore bco = new MaintainTransSpecStore(ConntionDB); dt_Detail = bco.QuerySchema(); } } #endregion #region 新增一筆資料列 DataRow dRow = dt_Detail.NewRow(); //if (dt_Detail.Rows.Count == 0) //{ dRow["ID"] = 0; } //else //{ // DataView dv_Detail = new DataView(dt_Detail.Copy()); // dv_Detail.Sort = "ID ASC"; // dRow["ID"] = int.Parse(dv_Detail[0]["ID"].ToString()) + 1; //} dRow["ID"] = 0; dRow["STORE"] = txt_down_STORE; dRow["STORE_NAME"] = txt_down_STORE_NAME; dRow["ROUTE"] = txt_down_ROUTE; dRow["STEP"] = txt_down_STEP; dRow["CARTON_START_DATE"] = txt_down_CARTON_START_DATE; dRow["CARTON_END_DATE"] = txt_down_CARTON_END_DATE; dRow["CARTON"] = txt_dr_down_CARTON; dRow["BUSINESS_HOURS_START"] = txt_down_BUSINESS_HOURS_START; dRow["BUSINESS_HOURS_END"] = txt_down_BUSINESS_HOURS_END; dRow["UNION_START_DATE"] = txt_down_UNION_START_DATE; dRow["UNION_END_DATE"] = txt_down_UNION_END_DATE; dRow["UNION_SHIPPING"] = txt_dr_down_UNION_SHIPPING; // dRow["CARTON_OLD"] = txt_dr_down_CARTON; //edison 2010/1/15 dRow["UNION_SHIPPING_NAME"] = ((DropDownList)this.dr_down_UNION_SHIPPING.FindControl("D1")).SelectedItem.Text; //dRow["UNION_SHIPPING_NAME"] = ((DropDownList)(this.dr_down_UNION_SHIPPING.Controls[3])).SelectedItem.Text; dt_Detail.Rows.Add(dRow); #endregion } else if ((this.hid_PageStatus.Value == "INSERT" || this.hid_PageStatus.Value == "EDIT") && this.hid_ID.Value != string.Empty) { string s_FilterExpression = string.Empty; s_FilterExpression = "ID = " + this.hid_ID.Value; DataRow dRow = dt_Detail.Select(s_FilterExpression)[0]; if (dRow != null) { dRow["STORE"] = txt_down_STORE; dRow["STORE_NAME"] = txt_down_STORE_NAME; dRow["ROUTE"] = txt_down_ROUTE; dRow["STEP"] = txt_down_STEP; dRow["CARTON_START_DATE"] = txt_down_CARTON_START_DATE; dRow["CARTON_END_DATE"] = txt_down_CARTON_END_DATE; dRow["CARTON"] = txt_dr_down_CARTON; dRow["BUSINESS_HOURS_START"] = txt_down_BUSINESS_HOURS_START; dRow["BUSINESS_HOURS_END"] = txt_down_BUSINESS_HOURS_END; dRow["UNION_START_DATE"] = txt_down_UNION_START_DATE; dRow["UNION_END_DATE"] = txt_down_UNION_END_DATE; dRow["UNION_SHIPPING"] = txt_dr_down_UNION_SHIPPING; dRow["UNION_SHIPPING_NAME"] = ((DropDownList)this.dr_down_UNION_SHIPPING.FindControl("D1")).SelectedItem.Text; //dRow["UNION_SHIPPING_NAME"] = ((DropDownList)(this.dr_down_UNION_SHIPPING.Controls[3])).SelectedItem.Text; } } #region 清空 hid_ID this.hid_ID.Value = string.Empty; this.clearAddFormValue(); #endregion #region 新增資料到GridView this.gv_Detail.DataSource = dt_Detail; this.gv_Detail.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) < 0) ? 10 : int.Parse(TextBoxPagesize.Text); this.gv_Detail.PageIndex = 0; this.gv_Detail.DataBind(); #endregion #region 設定頁面狀態 SetPageStartValue(); #endregion }
} protected void Btn_Delete_Click(object sender, EventArgs e) { this.ErrorMsgLabel.Text = ""; this.EditFlagLabel.Text = ""; if (this.hid_PageStatus.Value == "VIEW") { this.checkData(); #region 刪除資料 ParameterList.Clear(); ParameterList.Add(GetValueSetParameter(this.SLP_StoreChain_Action.Text.Trim(), "string"));//通路 ParameterList.Add(GetValueSetParameter(this.SearchTypeValue1, "string"));//查詢方式-(1)紙箱 ParameterList.Add(GetValueSetParameter(this.SearchTypeValue2, "string"));//查詢方式-(2)營業時間 ParameterList.Add(GetValueSetParameter(this.SearchTypeValue3, "string"));//查詢方式-(3)共配 ParameterList.Add(DateTime.Now); ParameterList.Add(Session["UID"].ToString()); BCO.MaintainTransSpecStore bco = new MaintainTransSpecStore(ConntionDB); int k = bco.DeleteByChanNo(ParameterList, null); this.Btn_Query_Click(null, null); this.ResultMsgLabel.Text = ""; ShowErrorMessage("刪除成功"); #endregion }
public DataTable searchData() { this.checkData(); #region 清空靜態變數 dt_Detail = null; // dt_Detail_Original = null; #endregion #region 處理查詢 ParameterList.Clear(); ParameterList.Add(GetValueSetParameter(this.SLP_StoreChain_Action.Text.Trim(), "string"));//通路 ParameterList.Add(GetValueSetParameter(this.SearchTypeValue1, "string"));//查詢方式-(1)紙箱 ParameterList.Add(GetValueSetParameter(this.SearchTypeValue2, "string"));//查詢方式-(2)營業時間 ParameterList.Add(GetValueSetParameter(this.SearchTypeValue3, "string"));//查詢方式-(3)共配 ParameterList.Add(GetValueSetParameter(TextBoxRowCountLimit.Text, "int"));//筆數 BCO.MaintainTransSpecStore bco = new MaintainTransSpecStore(ConntionDB); DataTable Dt = bco.QueryAllDataBySearch(ParameterList); #endregion return Dt; }
protected void Btn_Query_Change_Click(object sender, EventArgs e) { try { ErrorMsgLabelChnage.Text = ""; ResultMsgLabelChnage.Text = ""; dt_DetailChange = null; DataTable Dt = new DataTable(); if (this.SLP_StoreChain_Change.Text.Trim() == "") { ShowErrorMessage("請輸入[通路]"); return; } #region 處理查詢 BCO.MaintainTransSpecStore bco = new MaintainTransSpecStore(ConntionDB); DataTable changeDt = bco.QueryChangeStoreByChanNo(this.SLP_StoreChain_Change.Text.Trim(), int.Parse( TextBoxRowCountLimitChange.Text)); if (changeDt == null || (changeDt != null && changeDt.Rows.Count <= 0)) { ResultMsgLabelChnage.Text = "查無資料"; } #endregion #region 設定查詢結果 dt_DetailChange = changeDt.Copy(); this.gv_DetailChnage.DataSource = changeDt; this.gv_DetailChnage.PageSize = (TextBoxPagesizeChange.Text == "") ? 10 : (int.Parse(TextBoxPagesizeChange.Text) < 0) ? 10 : int.Parse(TextBoxPagesizeChange.Text); this.gv_DetailChnage.PageIndex = 0; this.gv_DetailChnage.DataBind(); #endregion } catch (Exception ex) { this.ErrorMsgLabel.Text = ex.ToString(); } finally { }
[ScriptMethod()] public static string checkStoreExist(string stordID) { String rtnValue = ""; if (stordID != "") { BCO.MaintainTransSpecStore bco = new MaintainTransSpecStore(ConntionDB); } return rtnValue;
[ScriptMethod()] public static string GetStoreRoute(string stordID) { String rtnValue = ""; if (stordID != "") { BCO.MaintainTransSpecStore bco = new MaintainTransSpecStore(ConntionDB); DataTable dt = bco.QueryByStoreID(stordID); if (dt != null && dt.Rows.Count > 0) { rtnValue = "transFail"; } else { dt = bco.QueryStoreRouteByID(stordID); if (dt != null && dt.Rows.Count > 0) { String sROUTE = (String)(dt.Rows[0]["ROUTE"]); String sSTEP = (String)(dt.Rows[0]["STEP"]); String sSTORE_NAME = (String)(dt.Rows[0]["STORE_NAME"]); rtnValue = sROUTE + "|" + sSTEP + "|" + sSTORE_NAME; } else { rtnValue = "fail"; } } } return rtnValue;