示例#1
0
        private void LoadCurrentAgence()
        {
            Agence s = AgenceBLL.ReturnAgence();

            if (s != null ? s.Id > 0 : false)
            {
                cbox_agence.SelectedText = s.Name;
                agence = s;
                txt_name_agence.Text = s.Name;
            }
        }
示例#2
0
 private void com_societe_SelectedIndexChanged(object sender, EventArgs e)
 {
     societe = societes[com_societe.SelectedIndex];
     if (users.AccesMultiAgence)
     {
         agences = AgenceBLL.List("select * from yvs_agences where societe = " + societe.Id);
     }
     else
     {
         agences.Add(users.Agence);
     }
     if (agences.Count > 0)
     {
         agence = agences[0];
         LoadAgence(agences);
     }
 }
示例#3
0
 private void LoadAgence()
 {
     agences = AgenceBLL.List("select * from yvs_agences where societe = " + Constantes.SOCIETE.Id);
     agences.Insert(0, new Agence(0, "---"));
     try
     {
         cbox_agence.Items.Clear();
         for (int i = 0; i < agences.Count; i++)
         {
             cbox_agence.Items.Add(agences[i].Name);
             cbox_agence.AutoCompleteCustomSource.Add(agences[i].Name);
         }
         cbox_agence.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
         cbox_agence.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
     catch (Exception ex)
     {
         Messages.Exception("Form_Setting (LoadAgence)", ex);
         cbox_agence.Items.Clear();
     }
 }
示例#4
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);
            }
        }
示例#5
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();
             }
         }
     }
 }