private void btn_save_users_Click(object sender, EventArgs e) { if (DialogResult.Yes == Messages.Confirmation(Mots.Modifier.ToLower())) { Users bean = RecopieUser(); if (Utils.asString(Constantes.USERS.PasswordPC)) { if (!bean._PasswordPC.Equals(Constantes.USERS.PasswordPC)) { Messages.ShowErreur("Mot de passe de la machine n'est pas correct"); txt_old_password_pc.BackColor = Color.Red; return; } if (!bean._PasswordPC_.Equals(bean.PasswordPC)) { Messages.ShowErreur("Confirmation du mot de passe de la machine n'est pas correct"); txt_new_repassword_pc.BackColor = Color.Red; return; } } if (Utils.asString(Constantes.USERS.PasswordLog)) { if (!Utils.VerifyMd5Hash(bean._PasswordLog, Constantes.USERS.PasswordLog)) { Messages.ShowErreur("Mot de passe du logiciel n'est pas correct"); txt_old_password_log.BackColor = Color.Red; return; } if (!bean._PasswordLog_.Equals(bean.PasswordLog)) { Messages.ShowErreur("Confirmation du mot de passe du logiciel n'est pas correct"); txt_new_repassword_log.BackColor = Color.Red; return; } } string query = "select id from yvs_users_agence where users = " + users.Id + " and agence = " + Constantes.AGENCE.Id; object author = Bll.LoadOneObject(query, null); bean.PasswordLog = Utils.GetMd5Hash(bean.PasswordLog); users.Name = bean.Name; users.PasswordPC = bean.PasswordPC; users.PasswordLog = bean.PasswordLog; users.Author = author != null?Convert.ToInt32(author.ToString()) : 0; txt_author.Text = users.Author.ToString(); if (UsersBLL.CreateUsers(users)) { if (DialogResult.Yes == Messages.Confirmation(Mots.Restart_Now.ToLower())) { Application.ExitThread(); Application.Restart(); } else { Constantes.USERS = users; } } } }
private void btn_pass_Click(object sender, EventArgs e) { Users u = Recopiew(); if (UsersBLL.CreateUsers(u)) { ask_ = true; Application.Restart(); } }
private void Loggin() { try { string query = "select id from yvs_users_agence where users = " + users.Id + " and agence = " + agence.Id; object author = Bll.LoadOneObject(query, null); users.Author = author != null?Convert.ToInt32(author.ToString()) : 0; if (UsersBLL.CreateUsers(users)) { societe = SocieteBLL.OneById(societe.Id); SocieteBLL.CreateSociete(societe); AgenceBLL.CreateAgence(agence); ask_ = true; Application.Restart(); } } catch (Exception ex) { Messages.Exception(ex); } }