예제 #1
0
        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);
            }
        }
예제 #2
0
 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();
             }
         }
     }
 }