private void LoadSections() { DataTable _SectionResult = new DataTable(); GetSectionsAndName theData = new GetSectionsAndName { theSystemDBTag = this.theSystemDBTag, UserCurrentInfo = this.UserCurrentInfo }; List <string> sections = TProductionGlobal.getUserInfo(UserCurrentInfo.Connection).PlanBookSections; foreach (string item in sections) { MWDataManager.clsDataAccess temp = theData.theSectionsAndName(TProductionGlobal.ProdMonthAsString(Convert.ToDateTime(barProdMonth.EditValue.ToString())), item, TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID); temp.ExecuteInstruction(); if (temp.ResultsDataTable.Rows.Count != 0) { if (_SectionResult.Columns.Count == 0) { _SectionResult = temp.ResultsDataTable.Clone(); } _SectionResult.Merge(temp.ResultsDataTable); } } editListSections.DataSource = _SectionResult; editListSections.ValueMember = "SectionID"; editListSections.DisplayMember = "Name"; }
/// <summary> /// Updates the sections list for the selected production month /// </summary> public void updateSections() { CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer(); BMEBL._queryReturnType = CPMBusinessLayer.ReturnType.DataTable; BMEBL.SetsystemDBTag = systemDBTag; BMEBL.SetUserCurrentInfo = this.UserCurrentInfo; List <string> Thelist = TProductionGlobal.getUserInfo(UserCurrentInfo.Connection).PlanBookSections; DataTable _SectionResult = new DataTable(); GetSectionsAndName theData = new GetSectionsAndName(); theData.theSystemDBTag = systemDBTag; theData.UserCurrentInfo = UserCurrentInfo; List <string> sections = TProductionGlobal.getUserInfo(UserCurrentInfo.Connection).PlanBookSections; foreach (string item in sections) { MWDataManager.clsDataAccess temp = theData.theSectionsAndName(_prodMonth, item, TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID); temp.ExecuteInstruction(); if (temp.ResultsDataTable.Rows.Count != 0) { if (_SectionResult.Columns.Count == 0) { _SectionResult = temp.ResultsDataTable.Clone(); } _SectionResult.Merge(temp.ResultsDataTable); } } tblSections = _SectionResult; //} //if (BMEBL.get_Sections(Convert.ToString(_prodMonth), TProductionGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).MOHierarchicalID.ToString()) == true) //{ // tblSections = BMEBL.ResultsDataTable.Clone(); // tblSections = BMEBL.ResultsDataTable.Copy(); //} }