public static ContactDS GetContacts() { // ContactDS contacts = null; try { // contacts = new ContactDS(); if (_Mediator.OnLine) { DataSet ds = _Mediator.FillDataset(USP_CONTACTS, TBL_CONTACTS, null); if (ds.Tables[TBL_CONTACTS].Rows.Count > 0) { DataSet _ds = new DataSet(); _ds.Merge(ds.Tables[TBL_CONTACTS].Select("", "FirstName ASC")); contacts.Merge(_ds); for (int i = 0; i < contacts.IssueContactTable.Rows.Count; i++) { contacts.IssueContactTable[i].FullName = contacts.IssueContactTable[i].FirstName + " " + contacts.IssueContactTable[i].LastName; } } } } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new contact.", ex); } return(contacts); }
public ContactDS GetContacts(int companyID, string regionNumber, string districtNumber, string agentNumber, string storeNumber) { ContactDS contacts = null; try { // contacts = new ContactDS(); DataSet ds = fillDataset(USP_CONTACTS_BYLOC, TBL_CONTACTS, new object[] { companyID, regionNumber, districtNumber, agentNumber, storeNumber }); if (ds.Tables[TBL_CONTACTS].Rows.Count > 0) { contacts.Merge(ds); for (int i = 0; i < contacts.ContactTable.Rows.Count; i++) { contacts.ContactTable[i].FullName = contacts.ContactTable[i].FirstName + " " + contacts.ContactTable[i].LastName; } } } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new contact.", ex); } return(contacts); }