/// <summary> /// 取得原始資料庫資料 /// </summary> private void GetAllOriginalDatatables() { #region try { #region ArrayList ParameterList1 = new ArrayList();//20091106 ParameterList1.Clear(); ParameterList1.Add(s_DISNO); ParameterList1.Add(s_ITEM); ParameterList1.Add(s_PERIOD); ParameterList1.Add(null);//CHAN_NO #region DIS_MAIN ALOModel.MaintainDisMain BCO1 = new ALOModel.MaintainDisMain(ConnectionDB); dtDisMainOld = BCO1.QueryByDisNo(ParameterList1); dtDisMain = dtDisMainOld.Copy(); DataColumn[] PrimaryKeys11 = new DataColumn[1]; PrimaryKeys11[0] = dtDisMainOld.Columns["DIS_NO"]; dtDisMainOld.PrimaryKey = PrimaryKeys11; DataColumn[] PrimaryKeys12 = new DataColumn[1]; PrimaryKeys12[0] = dtDisMain.Columns["DIS_NO"]; dtDisMain.PrimaryKey = PrimaryKeys12; #endregion #region DIS_ITEM ALOModel.MaintainDisItem BCO2 = new ALOModel.MaintainDisItem(ConnectionDB); dtDisItemOld = BCO2.QueryByDisNo(ParameterList1); dtDisItem = dtDisItemOld.Copy(); DataColumn[] PrimaryKeys21 = new DataColumn[3]; PrimaryKeys21[0] = dtDisItemOld.Columns["DIS_NO"]; PrimaryKeys21[1] = dtDisItemOld.Columns["ITEM"]; PrimaryKeys21[2] = dtDisItemOld.Columns["PERIOD"]; dtDisItemOld.PrimaryKey = PrimaryKeys21; DataColumn[] PrimaryKeys22 = new DataColumn[3]; PrimaryKeys22[0] = dtDisItem.Columns["DIS_NO"]; PrimaryKeys22[1] = dtDisItem.Columns["ITEM"]; PrimaryKeys22[2] = dtDisItem.Columns["PERIOD"]; dtDisItem.PrimaryKey = PrimaryKeys22; #endregion #region DIS_CHAN ALOModel.MaintainDisChan BCO3 = new ALOModel.MaintainDisChan(ConnectionDB); dtDisChanOld = BCO3.QueryDisChanFor111(ParameterList1); dtDisChan = dtDisChanOld.Copy(); DataColumn[] PrimaryKeys31 = new DataColumn[4]; PrimaryKeys31[0] = dtDisChanOld.Columns["DIS_NO"]; PrimaryKeys31[1] = dtDisChanOld.Columns["ITEM"]; PrimaryKeys31[2] = dtDisChanOld.Columns["PERIOD"]; PrimaryKeys31[3] = dtDisChanOld.Columns["CHAN_NO"]; dtDisChanOld.PrimaryKey = PrimaryKeys31; DataColumn[] PrimaryKeys32 = new DataColumn[4]; PrimaryKeys32[0] = dtDisChan.Columns["DIS_NO"]; PrimaryKeys32[1] = dtDisChan.Columns["ITEM"]; PrimaryKeys32[2] = dtDisChan.Columns["PERIOD"]; PrimaryKeys32[3] = dtDisChan.Columns["CHAN_NO"]; dtDisChan.PrimaryKey = PrimaryKeys32; #endregion #region DIS_CHAN_REFER //ALOModel.MaintainDisChanRefer BCO9 = new ALOModel.MaintainDisChanRefer(ConnectionDB); //dtDisChanReferOld = BCO9.QueryDisChanReferByDisNo(ParameterList1); //dtDisChanRefer = dtDisChanReferOld.Copy(); //DataColumn[] PrimaryKeys91 = new DataColumn[6]; //PrimaryKeys91[0] = dtDisChanReferOld.Columns["DIS_NO"]; //PrimaryKeys91[1] = dtDisChanReferOld.Columns["ITEM"]; //PrimaryKeys91[2] = dtDisChanReferOld.Columns["PERIOD"]; //PrimaryKeys91[3] = dtDisChanReferOld.Columns["CHAN_NO"]; //PrimaryKeys91[4] = dtDisChanReferOld.Columns["RITEM"]; //PrimaryKeys91[5] = dtDisChanReferOld.Columns["RPERIOD"]; //dtDisChanReferOld.PrimaryKey = PrimaryKeys91; //DataColumn[] PrimaryKeys92 = new DataColumn[6]; //PrimaryKeys92[0] = dtDisChanRefer.Columns["DIS_NO"]; //PrimaryKeys92[1] = dtDisChanRefer.Columns["ITEM"]; //PrimaryKeys92[2] = dtDisChanRefer.Columns["PERIOD"]; //PrimaryKeys92[3] = dtDisChanRefer.Columns["CHAN_NO"]; //PrimaryKeys92[4] = dtDisChanRefer.Columns["RITEM"]; //PrimaryKeys92[5] = dtDisChanRefer.Columns["RPERIOD"]; //dtDisChanRefer.PrimaryKey = PrimaryKeys92; #endregion #region DIS_ITEM_REFER ALOModel.MaintainDisItemRefer BCO4 = new ALOModel.MaintainDisItemRefer(ConnectionDB); dtDisItemReferOld = BCO4.QueryDisItemReferFor111(ParameterList1); dtDisItemRefer = dtDisItemReferOld.Copy(); DataColumn[] PrimaryKeys41 = new DataColumn[5]; PrimaryKeys41[0] = dtDisItemReferOld.Columns["DIS_NO"]; PrimaryKeys41[1] = dtDisItemReferOld.Columns["ITEM"]; PrimaryKeys41[2] = dtDisItemReferOld.Columns["PERIOD"]; PrimaryKeys41[3] = dtDisItemReferOld.Columns["RITEM"]; PrimaryKeys41[4] = dtDisItemReferOld.Columns["RPERIOD"]; dtDisItemReferOld.PrimaryKey = PrimaryKeys41; DataColumn[] PrimaryKeys42 = new DataColumn[5]; PrimaryKeys42[0] = dtDisItemRefer.Columns["DIS_NO"]; PrimaryKeys42[1] = dtDisItemRefer.Columns["ITEM"]; PrimaryKeys42[2] = dtDisItemRefer.Columns["PERIOD"]; PrimaryKeys42[3] = dtDisItemRefer.Columns["RITEM"]; PrimaryKeys42[4] = dtDisItemRefer.Columns["RPERIOD"]; dtDisItemRefer.PrimaryKey = PrimaryKeys42; #endregion #region DIS_TYPE_TMP ALOModel.MaintainDisTypeTmp BCO5 = new ALOModel.MaintainDisTypeTmp(ConnectionDB); dtDisTypeTmpOld = BCO5.QueryDisTypeTmp(ParameterList1); dtDisTypeTmp = dtDisTypeTmpOld.Copy(); DataColumn[] PrimaryKeys51 = new DataColumn[4]; PrimaryKeys51[0] = dtDisTypeTmpOld.Columns["DIS_NO"]; PrimaryKeys51[1] = dtDisTypeTmpOld.Columns["ITEM"]; PrimaryKeys51[2] = dtDisTypeTmpOld.Columns["PERIOD"]; PrimaryKeys51[3] = dtDisTypeTmpOld.Columns["DIS_TYPE"]; dtDisTypeTmpOld.PrimaryKey = PrimaryKeys51; DataColumn[] PrimaryKeys52 = new DataColumn[4]; PrimaryKeys52[0] = dtDisTypeTmp.Columns["DIS_NO"]; PrimaryKeys52[1] = dtDisTypeTmp.Columns["ITEM"]; PrimaryKeys52[2] = dtDisTypeTmp.Columns["PERIOD"]; PrimaryKeys52[3] = dtDisTypeTmp.Columns["DIS_TYPE"]; dtDisTypeTmp.PrimaryKey = PrimaryKeys52; #endregion #region DIS_TYPE_109_TMP ALOModel.MaintainDisType109Tmp BCO6 = new ALOModel.MaintainDisType109Tmp(ConnectionDB); dtDisType109TmpOld = BCO6.QueryDisType109Tmp(ParameterList1); dtDisTypeTmp109 = dtDisType109TmpOld.Copy(); DataColumn[] PrimaryKeys61 = new DataColumn[6]; PrimaryKeys61[0] = dtDisType109TmpOld.Columns["DIS_NO"]; PrimaryKeys61[1] = dtDisType109TmpOld.Columns["ITEM"]; PrimaryKeys61[2] = dtDisType109TmpOld.Columns["PERIOD"]; PrimaryKeys61[3] = dtDisType109TmpOld.Columns["RANK_CODE"]; PrimaryKeys61[4] = dtDisType109TmpOld.Columns["RANK_LEVEL"]; PrimaryKeys61[5] = dtDisType109TmpOld.Columns["PATTERN_NO"]; dtDisType109TmpOld.PrimaryKey = PrimaryKeys61; DataColumn[] PrimaryKeys62 = new DataColumn[6]; PrimaryKeys62[0] = dtDisTypeTmp109.Columns["DIS_NO"]; PrimaryKeys62[1] = dtDisTypeTmp109.Columns["ITEM"]; PrimaryKeys62[2] = dtDisTypeTmp109.Columns["PERIOD"]; PrimaryKeys62[3] = dtDisTypeTmp109.Columns["RANK_CODE"]; PrimaryKeys62[4] = dtDisTypeTmp109.Columns["RANK_LEVEL"]; PrimaryKeys62[5] = dtDisTypeTmp109.Columns["PATTERN_NO"]; dtDisTypeTmp109.PrimaryKey = PrimaryKeys62; #endregion #region DIS_ASSIST ALOModel.MaintainDisAssist BCO7 = new ALOModel.MaintainDisAssist(ConnectionDB); dtDisAssistMainOld = BCO7.QueryDisAssistMainWithoutChan(ParameterList1); dtDisAssistMain = dtDisAssistMainOld.Copy(); DataColumn[] PrimaryKeys71 = new DataColumn[4]; PrimaryKeys71[0] = dtDisAssistMainOld.Columns["DIS_NO"]; PrimaryKeys71[1] = dtDisAssistMainOld.Columns["ITEM"]; PrimaryKeys71[2] = dtDisAssistMainOld.Columns["PERIOD"]; PrimaryKeys71[3] = dtDisAssistMainOld.Columns["ASSIST_CODE"]; dtDisAssistMainOld.PrimaryKey = PrimaryKeys71; DataColumn[] PrimaryKeys72 = new DataColumn[4]; PrimaryKeys72[0] = dtDisAssistMain.Columns["DIS_NO"]; PrimaryKeys72[1] = dtDisAssistMain.Columns["ITEM"]; PrimaryKeys72[2] = dtDisAssistMain.Columns["PERIOD"]; PrimaryKeys72[3] = dtDisAssistMain.Columns["ASSIST_CODE"]; dtDisAssistMain.PrimaryKey = PrimaryKeys72; //20090818 added dtDisAssistDetlAll = BCO7.QueryDisAssistDetlWithoutChan(ParameterList1); #endregion #region DIS_REC ALOModel.MaintainDisTmpRec BCO8 = new ALOModel.MaintainDisTmpRec(ConnectionDB); ParameterList1.Clear(); ParameterList1.Add(s_ID_DisRec); dtDisTmpRecOld = BCO8.QueryById(ParameterList1); dtDisTmpRec = dtDisTmpRecOld.Copy(); DataColumn[] PrimaryKeys81 = new DataColumn[2]; PrimaryKeys81[0] = dtDisTmpRecOld.Columns["ID"]; PrimaryKeys81[1] = dtDisTmpRecOld.Columns["CODE"]; dtDisTmpRecOld.PrimaryKey = PrimaryKeys81; DataColumn[] PrimaryKeys82 = new DataColumn[2]; PrimaryKeys82[0] = dtDisTmpRec.Columns["ID"]; PrimaryKeys82[1] = dtDisTmpRec.Columns["CODE"]; dtDisTmpRec.PrimaryKey = PrimaryKeys82; #endregion #endregion } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } #endregion }
/// <summary> /// 抓取配本方式為105或110的暫存資料(編輯模式) /// </summary> private void GetDisType105Or110TempDataForEdit() { ALOModel.MaintainDisTypeTmp MDTT = new ALOModel.MaintainDisTypeTmp(ConnectionDB); #region 輸入變數 ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); //配本序號 ParameterList.Add(DISNOTxt.Text); //配本商品 ParameterList.Add(SLP_SKU1.Text); //期別 ParameterList.Add(SLP_ItemPeriod1.Text); #endregion DataTable Dt = MDTT.QueryDisTypeTmp(ParameterList); if (SLP_PARAM1.Text == "105") { Session[SessionDisTypeTmp105IDName] = Dt.Rows[0]["DIS_QTY"].ToString(); } if (SLP_PARAM1.Text == "110") { Session[SessionDisTypeTmp110IDName] = Dt.Rows[0]["DIS_QTY"].ToString(); } }