public void DisplayUserDataOn(Panel panelUserData)
        {
            UserDataControler userDataControler = new UserDataControler(_libraryPresenter, user);

            panelUserData.Controls.Add(userDataControler);
            userDataControler.BringToFront();
        }
Beispiel #2
0
        public void DisplayUserDataAfterClick(DataGridViewCellEventArgs e, DataGridView dataGridViewUsers, Panel panel, Button userButton)
        {
            dataGridViewUsers.Visible = false;
            IUser user = null;

            try
            {
                string cellclicked = dataGridViewUsers.Rows[e.RowIndex].Cells[0].Value.ToString();
                foreach (var item in _libraryPresenter.Container.users.Get())
                {
                    if (item.UserId.ToString().Equals(cellclicked))
                    {
                        user = item;
                    }
                }
            }
            catch
            {
            }

            if (user != null)
            {
                selectedUser              = user;
                userdataControler         = new UserDataControler(_libraryPresenter, user);
                userdataControler.Visible = true;
                userButton.Text           = user.FirstName + " " + user.LastName + " Menu";
                userButton.Visible        = true;
                panel.Controls.Add(userdataControler);
            }
        }