private void LoadOptions() { ContactGroups clsContactGroup = new ContactGroups(); cboGroup.DataTextField = "ContactGroupName"; cboGroup.DataValueField = "ContactGroupID"; cboGroup.DataSource = clsContactGroup.ListAsDataTable().DefaultView; cboGroup.DataBind(); cboGroup.SelectedIndex = 0; //cboGroup.Items.Count - 1; cboGroup.SelectedIndex = cboGroup.Items.IndexOf(cboGroup.Items.FindByValue(ContactGroupCategory.CUSTOMER.ToString("d"))); Department clsDepartment = new Department(clsContactGroup.Connection, clsContactGroup.Transaction); cboDepartment.DataTextField = "DepartmentName"; cboDepartment.DataValueField = "DepartmentID"; cboDepartment.DataSource = clsDepartment.ListAsDataTable().DefaultView; cboDepartment.DataBind(); cboDepartment.SelectedIndex = 0; Positions clsPosition = new Positions(clsContactGroup.Connection, clsContactGroup.Transaction); cboPosition.DataTextField = "PositionName"; cboPosition.DataValueField = "PositionID"; cboPosition.DataSource = clsPosition.ListAsDataTable("PositionName", SortOption.Ascending, 0).DefaultView; cboPosition.DataBind(); cboPosition.SelectedIndex = 0; Salutation clsSalutation = new Salutation(clsContactGroup.Connection, clsContactGroup.Transaction); cboSalutation.DataTextField = "SalutationName"; cboSalutation.DataValueField = "SalutationCode"; cboSalutation.DataSource = clsSalutation.ListAsDataTable().DefaultView; cboSalutation.DataBind(); cboSalutation.SelectedIndex = 0; cboSalutation.SelectedIndex = cboSalutation.Items.IndexOf(cboSalutation.Items.FindByValue("MR")); Contacts clsContacts = new Contacts(clsContactGroup.Connection, clsContactGroup.Transaction); cboSoldBy.DataTextField = "ContactName"; cboSoldBy.DataValueField = "ContactCode"; cboSoldBy.DataSource = clsContacts.AgentsAsDataTable(SortField: "ContactName").DefaultView; cboSoldBy.DataBind(); cboSoldBy.SelectedIndex = 0; Security.AccessUser clsAccessUser = new Security.AccessUser(clsContactGroup.Connection, clsContactGroup.Transaction); cboConfirmedBy.DataTextField = "Name"; cboConfirmedBy.DataValueField = "Name"; cboConfirmedBy.DataSource = clsAccessUser.ListAsDataTable(SortField: "Name").DefaultView; cboConfirmedBy.DataBind(); cboConfirmedBy.SelectedIndex = 0; Security.Country clsCountry = new Security.Country(clsContactGroup.Connection, clsContactGroup.Transaction); cboCountry.DataTextField = "CountryName"; cboCountry.DataValueField = "CountryID"; cboCountry.DataSource = clsCountry.ListAsDataTable().DefaultView; cboCountry.DataBind(); cboCountry.SelectedIndex = 0; clsContactGroup.CommitAndDispose(); }
private void LoadOptions() { Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"], Session.SessionID)); lblContactID.Text = iID.ToString(); ContactGroups clsContactGroup = new ContactGroups(); cboGroup.DataTextField = "ContactGroupName"; cboGroup.DataValueField = "ContactGroupID"; cboGroup.DataSource = clsContactGroup.ListAsDataTable().DefaultView; cboGroup.DataBind(); cboGroup.SelectedIndex = cboGroup.Items.Count - 1; Department clsDepartment = new Department(clsContactGroup.Connection, clsContactGroup.Transaction); cboDepartment.DataTextField = "DepartmentName"; cboDepartment.DataValueField = "DepartmentID"; cboDepartment.DataSource = clsDepartment.ListAsDataTable().DefaultView; cboDepartment.DataBind(); cboDepartment.SelectedIndex = 0; Positions clsPosition = new Positions(clsContactGroup.Connection, clsContactGroup.Transaction); cboPosition.DataTextField = "PositionName"; cboPosition.DataValueField = "PositionID"; cboPosition.DataSource = clsPosition.ListAsDataTable("PositionName", SortOption.Ascending, 0).DefaultView; cboPosition.DataBind(); cboPosition.SelectedIndex = 0; cboCreditCardStatus.Items.Clear(); foreach (CreditCardStatus selection in Enum.GetValues(typeof(CreditCardStatus))) { cboCreditCardStatus.Items.Add(new ListItem(selection.ToString("G"), selection.ToString("d"))); } cboCreditCardStatus.SelectedIndex = cboCreditCardStatus.Items.IndexOf(cboCreditCardStatus.Items.FindByValue(CreditCardStatus.All.ToString("d"))); Data.CardType clsCardType = new Data.CardType(clsContactGroup.Connection, clsContactGroup.Transaction); cboCreditCardType.Items.Clear(); cboCreditCardType.DataTextField = "CardTypeName"; cboCreditCardType.DataValueField = "CardTypeID"; cboCreditCardType.DataSource = clsCardType.ListAsDataTable(new CardTypeDetails(CreditCardTypes.Internal)).DefaultView; cboCreditCardType.DataBind(); cboCreditCardType.SelectedIndex = 0; Billing clsBilling = new Billing(clsContactGroup.Connection, clsContactGroup.Transaction); cboBillingDate.DataTextField = "BillingDate"; cboBillingDate.DataValueField = "BillingFile"; cboBillingDate.DataSource = clsBilling.ListBillingDateAsDataTable(CreditType.Individual, long.Parse(lblContactID.Text), limit: 10).DefaultView; cboBillingDate.DataBind(); cboBillingDate.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.PLEASE_SELECT)); cboBillingDate.SelectedIndex = 0; Salutation clsSalutation = new Salutation(clsContactGroup.Connection, clsContactGroup.Transaction); cboSalutation.DataTextField = "SalutationName"; cboSalutation.DataValueField = "SalutationCode"; cboSalutation.DataSource = clsSalutation.ListAsDataTable().DefaultView; cboSalutation.DataBind(); cboSalutation.SelectedIndex = 0; cboSalutation.SelectedIndex = cboSalutation.Items.IndexOf(cboSalutation.Items.FindByValue("MR")); clsContactGroup.CommitAndDispose(); }
private void LoadOptions() { ContactGroups clsContactGroup = new ContactGroups(); cboGroup.DataTextField = "ContactGroupName"; cboGroup.DataValueField = "ContactGroupID"; cboGroup.DataSource = clsContactGroup.ListAsDataTable(ContactGroupCategory.CUSTOMER).DefaultView; cboGroup.DataBind(); cboGroup.SelectedIndex = 0; //cboGroup.Items.Count - 1; Department clsDepartment = new Department(clsContactGroup.Connection, clsContactGroup.Transaction); cboDepartment.DataTextField = "DepartmentName"; cboDepartment.DataValueField = "DepartmentID"; cboDepartment.DataSource = clsDepartment.ListAsDataTable().DefaultView; cboDepartment.DataBind(); cboDepartment.SelectedIndex = 0; Positions clsPosition = new Positions(clsContactGroup.Connection, clsContactGroup.Transaction); cboPosition.DataTextField = "PositionName"; cboPosition.DataValueField = "PositionID"; cboPosition.DataSource = clsPosition.ListAsDataTable("PositionName", SortOption.Ascending, 0).DefaultView; cboPosition.DataBind(); cboPosition.SelectedIndex = 0; Salutation clsSalutation = new Salutation(clsContactGroup.Connection, clsContactGroup.Transaction); cboSalutation.DataTextField = "SalutationName"; cboSalutation.DataValueField = "SalutationCode"; cboSalutation.DataSource = clsSalutation.ListAsDataTable().DefaultView; cboSalutation.DataBind(); cboSalutation.SelectedIndex = 0; cboSalutation.SelectedIndex = cboSalutation.Items.IndexOf(cboSalutation.Items.FindByValue("MR")); clsContactGroup.CommitAndDispose(); }