Пример #1
0
        public List<DbUser> GetUserList(AddUser userDetails)
        {
            // Home home = new Home(sessionId);
            //GetUser checkUserName = new GetUser();
            int num = client.GetNumOfUsers(userDetails.firstnameTxtbox.Text,
                                        userDetails.lastnameTxtbox.Text);
            DbUser user = new DbUser();
            if (num < 1)
            {
                user.Username = userDetails.firstnameTxtbox.Text + "." + userDetails.lastnameTxtbox.Text;
            }
            else
            {
                user.Username = userDetails.firstnameTxtbox.Text + "." +
                    userDetails.lastnameTxtbox.Text + num;
            }
            user.Password = "******";
            user.FirstName = userDetails.firstnameTxtbox.Text;
            user.LastName = userDetails.lastnameTxtbox.Text;
            user.Email = user.Username + "@fdmgroup.com";
            user.Location = userDetails.locTxtbox.Text;
            user.TypeId = userDetails.userTypeCombox.SelectedIndex +1;

            List<DbUser> userList = new List<DbUser>();
            userList.Add(user);

            return userList.ToList();
        }
Пример #2
0
 public void FillUserType(AddUser userType)
 {
     List<string> uType = new List<string>();
        uType = client.GetUserType().ToList();
        for (int i = 0; i < uType.Count(); i++)
        {
        userType.userTypeCombox.Items.Add(uType[i]);
        }
 }
Пример #3
0
 public void FillStream(AddUser stream)
 {
     List<string> streamList = new List<string>();
        streamList = client.GetStreamList().ToList();
        for (int i = 0; i < streamList.Count(); i++)
        {
        if (streamList[i] != "All")
        {
            stream.streamCombox.Items.Add(streamList[i]);
        }
        }
 }
Пример #4
0
        public void FillStream(AddUser stream)
        {
            List <string> streamList = new List <string>();

            streamList = client.GetStreamList().ToList();
            for (int i = 0; i < streamList.Count(); i++)
            {
                if (streamList[i] != "All")
                {
                    stream.streamCombox.Items.Add(streamList[i]);
                }
            }
        }
Пример #5
0
 private void loginLogin()
 {
     if ((usernameTxtbox.Text != null) && (passwordBox.Password != null))
     {
         Guid sessionId = client.Login(usernameTxtbox.Text, passwordBox.Password, "Administrator");
         if (sessionId == Guid.Empty)
         {
             MessageBox.Show("Invalid login details. Please try again.", "Invalid Login",
                             MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             AddUser addUser = new AddUser(sessionId);
             addUser.SetAdminUsername(usernameTxtbox.Text);
             this.Hide();
             addUser.Show();
         }
     }
 }
Пример #6
0
 private void loginLogin()
 {
     if ((usernameTxtbox.Text != null) && (passwordBox.Password != null))
     {
         Guid sessionId = client.Login(usernameTxtbox.Text, passwordBox.Password, "Administrator");
         if (sessionId == Guid.Empty)
         {
             MessageBox.Show("Invalid login details. Please try again.", "Invalid Login",
                 MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             AddUser addUser = new AddUser(sessionId);
             addUser.SetAdminUsername(usernameTxtbox.Text);
             this.Hide();
             addUser.Show();
         }
     }
 }
Пример #7
0
 public void setAdminAppForm(AddUser form)
 {
     this.form = form;
 }
Пример #8
0
 public void setAdminAppForm(AddUser form)
 {
     this.form = form;
 }