public UserManager(CL_User u)
 {
     this.user = u;
     InitializeComponent();
     this.tbName.Text = user.getUserName();
     this.tbForName.Text = user.getUserForName();
     this.tbLogin.Text = user.getUserLogin();
     this.tbPass.Text = user.getUserPassword();
     this.btSubmit.Enabled = true;
 }
 public CL_User bl_SearchUser(string login, string password)
 {
     CL_User user = new CL_User();
     ds = oCAD.m_GetRows(oMpgUser.SearchUser(login, password), "USER");
     user.setUserId(int.Parse(ds.Tables["USER"].Rows[0]["ID_USER"].ToString()));
     user.setUserName(ds.Tables["USER"].Rows[0]["NAME_USER"].ToString());
     user.setUserForName(ds.Tables["USER"].Rows[0]["FORNAME_USER"].ToString());
     user.setUserLogin(ds.Tables["USER"].Rows[0]["LOGIN_USER"].ToString());
     user.setUserPassword(ds.Tables["USER"].Rows[0]["PASSWORD_USER"].ToString());
     return user;
 }
        private void btSubmit_Click(object sender, EventArgs e)
        {
            //TODO faire la verification du login et du mot de passe
            string login = tbLogin.Text;
            string pass = tbPass.Text;

            //bool passRight = bl_user.bl_CheckExistingUser(login, pass, "USER");
            bool passRight = true;
            if (passRight)
            {
                //this.user = bl_user.bl_SearchUser(login, pass);
                this.user = new CL_User();
                this.user.setUserId(1);
                this.user.setUserName("POKEMON");
                this.user.setUserForName("Jean");
                this.user.setUserLogin("aze");
                this.user.setUserPassword("123");

                //TODO recuperer les listes de l utilisateur

                this.lbInfo.Text = this.lbInfo.Text.Replace("member", user.getUserName());
                this.gpConnexion.Visible = false;
                this.gpMessage.Visible = false;
                this.lbInfo.Visible = true;
                this.gpLists.Visible = true;
                this.btAddList.Visible = true;
                this.lbInfo.Visible = true;

                List<CL_List> newList = new List<CL_List>();
                newList.Add(new CL_List("courses", DateTime.Now));
                newList.Add(new CL_List("ménage", DateTime.Now));
                newList.Add(new CL_List("recette de crepes", DateTime.Now));
                newList.Add(new CL_List("liste des cadeaux", DateTime.Now));

                foreach(CL_List listElement in newList)
                {
                    this.lvList.Items.Add(listElement.getName());
                }
            }
            else
            {
                this.tbLogin.Clear();
                this.tbPass.Clear();
                this.lbMessage.Text = "Login or Password has not been recognize. Please retry later or contact your Administrator.";
            }

        }