private DataTable MakeDetailTable(string strOutLS, string strInLS) { PIC.VDS2G.GFM.ITM.MaintainSKUPeriod bco = new PIC.VDS2G.GFM.ITM.MaintainSKUPeriod(ConntionDB); DataTable Dt_Detail = new DataTable(); Dt_Detail.Columns.Add("OUT_LS"); Dt_Detail.Columns.Add("IN_LS"); Dt_Detail.Columns.Add("ITEM"); Dt_Detail.Columns.Add("PERIOD"); Dt_Detail.Columns.Add("REMOVE_QTY"); Dt_Detail.Columns.Add("COST"); string strITEM = string.Empty;//品號 string strPERIOD = string.Empty;//期別 string strONHDX_QTY = string.Empty;//出庫儲位庫存量 string strST_ACCEPT_QTY = string.Empty;//進貨數量 int intONHDX_QTY = 0; int intST_ACCEPT_QTY = 0; int x = 0; int y = 0; for (int i = 0; i < GridView1.Rows.Count; i++) { strITEM = GridView1.Rows[i].Cells[0].Text; strPERIOD = GridView1.Rows[i].Cells[1].Text; strONHDX_QTY = GridView1.Rows[i].Cells[6].Text; strST_ACCEPT_QTY = GridView1.Rows[i].Cells[9].Text; if (int.TryParse(strONHDX_QTY, out x)) { intONHDX_QTY = x; } else { intONHDX_QTY = 0; } if (int.TryParse(strST_ACCEPT_QTY, out y)) { intST_ACCEPT_QTY = y; } else { intST_ACCEPT_QTY = 0; } //如果[出庫儲位庫存量] < [進貨數量],要建移轉單 if (intONHDX_QTY < intST_ACCEPT_QTY) { ParameterList.Clear(); ParameterList.Add(strPERIOD); ParameterList.Add(strITEM); DataTable Dt_Cost = bco.QueryForSLP(ParameterList); DataRow Dr_Detail = Dt_Detail.NewRow(); Dr_Detail["OUT_LS"] = strOutLS; Dr_Detail["IN_LS"] = strInLS; Dr_Detail["ITEM"] = strITEM; Dr_Detail["PERIOD"] = strPERIOD; Dr_Detail["REMOVE_QTY"] = intST_ACCEPT_QTY; Dr_Detail["COST"] = Dt_Cost.Rows[0]["COST"]; Dt_Detail.Rows.Add(Dr_Detail); } } return Dt_Detail; }
protected void txtPERIOD_Changed(object sender, EventArgs e) { if (txtITEM.Text == "" || txtPERIOD.Text == "") { txtPERIOD_BARCODE.Text = ""; txtMANUFACTURE.Text = ""; txtPUBLISH_TYPE.Text = ""; txtPRICE.Text = ""; return; } #region 期別000000,請至圖書採購卡維護資料 ITM.MaintainSKU bcoITEM = new PIC.VDS2G.GFM.ITM.MaintainSKU(ConntionDB); ParameterList.Clear(); ITM.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "MA.ITEM", txtITEM.Text, "=", "and"); DataTable dtItem = bcoITEM.QuerySKUByFind_1(ParameterList); if (dtItem.Rows.Count > 0) { DataRow drItem = dtItem.Rows[0]; if (drItem["ROOT_NO"].ToString() == "2" && IsPostBack) { ShowErrorMessage("該品號群分類為圖書,請至圖書採購卡維護資料"); txtITEM.Text = ""; txtPERIOD.Text = ""; hidITEM.Value = ""; hidPeriod.Value = ""; return; } else { //2010/09/24 added for more check #region MKT.MaintainPurchaseCard BCO_PC = new MKT.MaintainPurchaseCard(ConntionDB); ParameterList.Clear(); ParameterList.Add(txtITEM.Text); ParameterList.Add(txtPERIOD.Text); bool bResult = BCO_PC.CheckIsDuplicatedByItemPeriod(ParameterList); if (!bResult) { ScriptManager.RegisterStartupScript(this, this.GetType(), "JS", "alert('此品號/期別已開立過採購卡,請確認!');", true); } #endregion #region ITM.MaintainSKUPeriod bcoPeriod = new ITM.MaintainSKUPeriod(ConntionDB); ParameterList.Clear(); ITM.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "MA.ITEM", txtITEM.Text, "=", "and"); ITM.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "MA.PERIOD", txtPERIOD.Text, "=", "and"); DataTable dt = bcoPeriod.QuerySKUPeriodByFind_1(ParameterList); hidPeriod.Value = txtPERIOD.Text; if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; txtPERIOD_BARCODE.Text = dr["PERIOD_BARCODE"].ToString(); txtMANUFACTURE.Text = dr["VENDOR"].ToString(); txtPUBLISH_TYPE.Text = dr["PUBLISH_TYPE_NO"].ToString(); txtPRICE.Text = dr["PRICE"].ToString(); } else { txtPERIOD_BARCODE.Text = ""; txtMANUFACTURE.Text = ""; txtPUBLISH_TYPE.Text = ""; txtPRICE.Text = ""; } #endregion } } Focus(txtPLAN_ACCEPT_DATE.DateTextBox.ClientID); /* if (txtPERIOD.Text == "000000") { ShowErrorMessage("期別000000,請至圖書採購卡維護資料"); txtPERIOD.Text = ""; } */ #endregion }
/// <summary> /// 檢核ITEM及PERIOD的從屬關係 /// </summary> /// <param name="T1">品號</param> /// <param name="T2">期別</param> /// <returns>回傳false表無從屬關係</returns> private bool chkItem_Period(string T1, string T2) { bool isOK = false; if (T1.Trim().Length != 0 && T2.Trim().Length != 0) { ParameterList.Clear(); ParameterList.Add(T1); //品號 ParameterList.Add(T2); //期別 MaintainSKUPeriod bCo = new MaintainSKUPeriod(ConntionDB); string Dt = bCo.QueryVDS_ITM_PERIOD_MAIN(ParameterList); if (Dt != "0") isOK = true; } return isOK; }
public static string PageMethod_Chk_ITEM_BARCODE(string s_ServerString) { #region 規則 /* * 在新或編輯模式下 * 需求: * 1判斷欄位[商品條碼]不為0000000000000(13個0)時 OR 欄位[商品條碼]不等於空值: * 1.1 相同[品號]的條碼(商品條碼)=>可以重覆。 * 1.2 不同[品號]的條碼(商品條碼),顯示對話視窗詢問【條碼重覆,請確認是否異動】? * 1.2.1是=>異動資料。 * 1.2.2否=>不異動資料。 */ #endregion string s_Return_String = string.Empty; string[] s_Array_ServerString = System.Text.RegularExpressions.Regex.Split(s_ServerString, "<partition>", System.Text.RegularExpressions.RegexOptions.IgnoreCase); if (s_Array_ServerString[1] != string.Empty && s_Array_ServerString[1] != "0000000000000") { PIC.VDS2G.ACM.CAA.CAACommon CAAComm = new PIC.VDS2G.ACM.CAA.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(s_Array_ServerString[0], "string", false));//品號 ParameterList.Add(CAAComm.GetValueSetParameter(s_Array_ServerString[1], "string", false));//商品條碼 ParameterList.Add(CAAComm.GetValueSetParameter(HttpContext.Current.Session["UID"].ToString(), "string", false));//登入人員 //為什麼要用這一個BCO,搞不懂前面再寫什麼,所以隨便挑一個來寫 MaintainSKUPeriod PageMethod_bco = new MaintainSKUPeriod(ConntionDB); DataTable dt = PageMethod_bco.QUERYCHK_ITEM_BARCODE(ParameterList); s_Return_String = dt.Rows[0][0].ToString(); } else { //如果欄位[商品條碼]=13個0 或 空值,則不用判斷,可以繼續往下做 s_Return_String = "0"; } return s_Return_String; }
public static string PageMethod_Chk_VALIDATE_ISSUANCE(string s_ServerString) { #region 規則 /* * 在編輯模式下 * 需求:已配本的期別,要產生異動序號,顯示訊息【此期別已經出貨,是否確認修改】。 * 點選按鈕[產生異動序號]及[儲存]皆需判斷, * 這是要看資料庫該筆資料,不是畫面上使用者的修改後結果, * VDS_ITM_PERIOD_MAIN之欄位ACCT_VALIDATE=0(未審核)時 * 判斷VDS_ITM_PERIOD_PROFILE之欄位ISSUANCE_DATE(發行日期)是否有值 * PS:與秀玲確認過VDS_ITM_PERIOD_PROFILE這一個Table的PK是[品號]+[期別]+[異動序號] * 實際上[品號]+[期別]就可以找到唯一的值 * 1.1是:彈跳訊息:【此期別已經出貨,是否確認修改】 * 1.1.1點選是:繼續原本的動作。 * 1.1.2點選否:回到原畫面。 * 1.2否:執行儲存。 */ #endregion string[] s_Array_ServerString = System.Text.RegularExpressions.Regex.Split(s_ServerString, "<partition>", System.Text.RegularExpressions.RegexOptions.IgnoreCase); PIC.VDS2G.ACM.CAA.CAACommon CAAComm = new PIC.VDS2G.ACM.CAA.CAACommon(); ParameterList.Clear(); ParameterList.Add(CAAComm.GetValueSetParameter(s_Array_ServerString[0], "string", false));//品號 ParameterList.Add(CAAComm.GetValueSetParameter(s_Array_ServerString[1], "string", false));//期別 ParameterList.Add(CAAComm.GetValueSetParameter(HttpContext.Current.Session["UID"].ToString(), "string", false));//登入人員 //為什麼要用這一個BCO,搞不懂前面再寫什麼,所以隨便挑一個來寫 MaintainSKUPeriod PageMethod_bco = new MaintainSKUPeriod(ConntionDB); DataTable dt = PageMethod_bco.QUERYCHK_VALIDATE_ISSUANCE(ParameterList); return dt.Rows[0][0].ToString(); }
public static string PageMethod_chkItemPeriod(string s_ServerString) { string s_Return_String = string.Empty; string[] s_ItemPeriod_String = System.Text.RegularExpressions.Regex.Split(s_ServerString, "<partition>", System.Text.RegularExpressions.RegexOptions.IgnoreCase); ParameterList.Clear(); SQLHelper.SQLWhere(ref ParameterList, DbType.String, "ITEM", s_ItemPeriod_String[0], "=", "and"); SQLHelper.SQLWhere(ref ParameterList, DbType.String, "PERIOD", s_ItemPeriod_String[1], "=", "and"); SQLHelper.SQLWhere(ref ParameterList, DbType.String, "ENABLE", "1", "=", "and"); MaintainSKUPeriod PageMethod_bco = new MaintainSKUPeriod(ConntionDB); string dt = PageMethod_bco.QueryChkItemPeriod(ParameterList); if (dt != "0") { s_Return_String = "品號、期別重複,請重新輸入"; } return s_Return_String; }
/// <summary> /// 檢核STORE_GROUP及STORE的從屬關係 /// </summary> /// <param name="T1">店群</param> /// <param name="T2">門市</param> /// <returns>回傳false表無從屬關係</returns> private bool chkStore_StoreGroup(string T1, string T2) { bool isOK = false; if (T1.Trim().Length != 0 && T2.Trim().Length != 0) { ParameterList.Clear(); ParameterList.Add(T1); //店群 ParameterList.Add(T2); //門市 MaintainSKUPeriod bCo = new MaintainSKUPeriod(ConntionDB); string Dt = bCo.QueryVDS_STM_STORE_UNIQUE(ParameterList); if (Dt != "0") isOK = true; } return isOK; }
public string ItemPeriodName(string Code, string Item ) { string Name = ""; string ConnectionDBStr = ((DatabaseSettings)ConfigurationManager.GetSection("dataConfiguration")).DefaultDatabase; MaintainSKUPeriod bco = new MaintainSKUPeriod(ConnectionDBStr); if (Code != "") { ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(Code); ParameterList.Add(Item); DataTable dt = bco.QueryForSLP(ParameterList); Name = ((dt.Rows.Count > 0) ? "" : "查無資料"); } return Name; }