Beispiel #1
0
		private void LoadOptions()
		{
			DataClass clsDataClass = new DataClass();
			Country clsCountry = new Country();
			
			cboCountry.DataTextField = "CountryName";
			cboCountry.DataValueField = "CountryID";
			cboCountry.DataSource = clsDataClass.DataReaderToDataTable(clsCountry.List("CountryName",SortOption.Ascending)).DefaultView;
			cboCountry.DataBind();
			cboCountry.SelectedIndex = cboCountry.Items.Count - 1;

			

			AccessGroup clsAccessGroup = new AccessGroup(clsCountry.Connection, clsCountry.Transaction);
			
			cboGroup.DataTextField = "GroupName";
			cboGroup.DataValueField = "GroupID";
			cboGroup.DataSource = clsDataClass.DataReaderToDataTable(clsAccessGroup.List("GroupName",SortOption.Ascending)).DefaultView;
			cboGroup.DataBind();
			cboGroup.SelectedIndex = cboGroup.Items.Count - 1;

            clsCountry.CommitAndDispose();
		}
        private void LoadOptions()
        {
            long lngID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"], Session.SessionID));
            lblUID.Text = lngID.ToString();

            DataClass clsDataClass = new DataClass();
            AccessUser clsAccessUser = new AccessUser();
            int intGroupID = clsAccessUser.Details(lngID).GroupID;

            AccessGroup clsAccessGroup = new AccessGroup(clsAccessUser.Connection, clsAccessUser.Transaction);
            cboGroup.DataTextField = "GroupName";
            cboGroup.DataValueField = "GroupID";
            cboGroup.DataSource = clsDataClass.DataReaderToDataTable(clsAccessGroup.List("GroupName", SortOption.Ascending)).DefaultView;
            cboGroup.DataBind();
            cboGroup.SelectedIndex = cboGroup.Items.IndexOf(cboGroup.Items.FindByValue(intGroupID.ToString()));

            clsAccessUser.CommitAndDispose();
        }