Beispiel #1
0
        private void FillUserApp()
        {
            string sqlString = "SELECT *,(SURNAME+' '+NAME) AS USERNAME FROM ACCOUNT WHERE UID=" + UC.UserId;

            sqlString             += " OR DIARYACCOUNT LIKE '|%" + UC.UserId.ToString() + "|%'";
            UserApp.DataTextField  = "UserName";
            UserApp.DataValueField = "uid";
            UserApp.DataSource     = DatabaseConnection.CreateDataset(sqlString);
            UserApp.DataBind();
            int actualUser;

            if (UC.ImpersonateUser == 0)
            {
                actualUser = UC.UserId;
            }
            else
            {
                actualUser = UC.ImpersonateUser;
            }
            UserApp.SelectedItem.Selected = false;
            foreach (ListItem li in UserApp.Items)
            {
                if (li.Value == actualUser.ToString())
                {
                    li.Selected = true;
                    break;
                }
            }
        }