private void btn_save_Click(object sender, EventArgs e) { if (societe != null ? societe.Id > 0 : false) { string adresse = txt_adresse.Text; societe.AdresseIp = adresse; societe.TypeConnexion = cbox_type_connexion.SelectedItem.ToString(); societe.Users = txt_users.Text; societe.Domain = txt_domain.Text; societe.Password = txt_password.Text; societe.Port = Convert.ToInt32(txt_port.Value); if (SocieteBLL.Update(societe)) { if (start) { ask_ = true; Application.Restart(); return; } else { if (Constantes.SOCIETE.Id.Equals(societe.Id) ? SocieteBLL.CreateSociete(societe) : false) { Constantes.SOCIETE = societe; if (Constantes.FORM_PARENT != null) { Constantes.FORM_PARENT.LoadInfosSociete(); } } } } Messages.Succes(); } }
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); } }
private void btn_save_Click(object sender, EventArgs e) { if (societe != null ? societe.Id > 0 : false) { if (SocieteBLL.CreateSociete(societe)) { if (agence != null ? agence.Id > 0 : false) { AgenceBLL.CreateAgence(agence); } else { AgenceBLL.RemoveAgence(); } Constantes.SOCIETE = societe; Constantes.AGENCE = agence; if (DialogResult.Yes == Messages.Confirmation(Mots.Restart_Now.ToLower())) { Application.ExitThread(); Application.Restart(); } } } }