private void Listdata() { try { grdList.Rows.Clear(); CompanyDataDB dbrecord = new CompanyDataDB(); int index = 0; CatalogueValueDB ACDb = new CatalogueValueDB(); List <cataloguevalue> acList = ACDb.getCatalogueValues(); List <cmpnydata> data = dbrecord.getData(cmbcmpnysrch.SelectedItem.ToString().Trim().Substring(0, cmbcmpnysrch.SelectedItem.ToString().Trim().IndexOf('-')).Trim()); foreach (cataloguevalue cv in acList) { index = 0; if (cv.catalogueID == "CompanyData") { foreach (cmpnydata dat in data) { if (cv.catalogueValueID.Equals(dat.DataID)) { grdList.Rows.Add(dat.DataID, dat.DataValue, ComboFIll.getStatusString(dat.status)); index = 1; } } if (index == 0) { grdList.Rows.Add(cv.catalogueValueID, "", ""); } } } grdList.Visible = true; } catch (Exception ex) { MessageBox.Show("Error in CompanyData listing"); } enableBottomButtons(); pnlRegionList.Visible = true; }
private void ListCatalogueValues(string CatalogueID) { try { grdList.Rows.Clear(); CatalogueValueDB dbrecord = new CatalogueValueDB(); List <cataloguevalue> CatalogueValues = dbrecord.getCatalogueValues(); foreach (cataloguevalue catval in CatalogueValues) { if (catval.catalogueID.Equals(CatalogueID)) { grdList.Rows.Add(catval.catalogueValueID, catval.description, ComboFIll.getStatusString(catval.status)); } } lblAddEditHeader.Text = CatalogueID; } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); } enableBottomButtons(); pnlCatalogueValueList.Visible = true; }