コード例 #1
0
ファイル: Form_Societe.cs プロジェクト: dowesw/ZK-Lymytz-V3.0
        private void LoadSociete(string groupe)
        {
            string query = "select y.id, y.name, y.adresse_ip, COALESCE(i.port, 0) AS port, i.users, i.password, i.domain, i.type_connexion, y.groupe, g.libelle " +
                           "from yvs_societes y left join yvs_base_groupe_societe g on y.groupe = g.id left join yvs_societes_connexion i on i.societe = y.id ";

            if (groupe != null ? groupe.Trim().Length > 0 : false)
            {
                query += " where g.libelle = '" + groupe + "'";
            }
            societes = SocieteBLL.List(query);
            try
            {
                cbox_societe.Items.Clear();
                for (int i = 0; i < societes.Count; i++)
                {
                    cbox_societe.Items.Add(societes[i].Name);
                    cbox_societe.AutoCompleteCustomSource.Add(societes[i].Name);
                }
                cbox_societe.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
                cbox_societe.AutoCompleteSource = AutoCompleteSource.CustomSource;
            }
            catch (Exception ex)
            {
                Messages.Exception("Form_Societe (LoadSociete)", ex);
                cbox_societe.Items.Clear();
            }
        }
コード例 #2
0
ファイル: Form_Societe.cs プロジェクト: dowesw/ZK-Lymytz-V3.0
        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();
            }
        }
コード例 #3
0
ファイル: Form_Setting.cs プロジェクト: dowesw/ZK-Lymytz-V3.0
        private void LoadCurrentSociete()
        {
            Societe s = SocieteBLL.ReturnSociete();

            if (s != null ? s.Id > 0 : false)
            {
                cbox_societe.SelectedText = s.Name;
                societe        = s;
                txt_name.Text  = s.Name;
                txt_group.Text = s.Groupe != null ? s.Groupe.Libelle : "";
                LoadAgence(s);
            }
        }
コード例 #4
0
        public void LoadPointeuse()
        {
            if (Constantes.POINTEUSES.Count < 1)
            {
                Societe s = SocieteBLL.ReturnSociete();
                Constantes.POINTEUSES = PointeuseBLL.List("select * from yvs_pointeuse where societe = " + s.Id + " order by adresse_ip");
            }
            dgv_pointeuse.Rows.Clear();
            ObjectThread o = new ObjectThread(dgv_pointeuse);

            foreach (Pointeuse p in Constantes.POINTEUSES)
            {
                o.WriteDataGridView(new object[] { p.Id, p.Ip, p.Emplacement, p.Type });
            }
        }
コード例 #5
0
ファイル: Form_Societe.cs プロジェクト: dowesw/ZK-Lymytz-V3.0
        private void LoadCurrentSociete()
        {
            Societe s = SocieteBLL.ReturnSociete();

            if (s != null ? s.Id > 0 : false)
            {
                cbox_societe.SelectedText = s.Name;
                societe                  = s;
                txt_name.Text            = s.Name;
                txt_adresse.Text         = s.AdresseIp;
                cbox_type_connexion.Text = s.TypeConnexion;
                txt_users.Text           = s.Users;
                txt_domain.Text          = s.Domain;
                txt_password.Text        = s.Password;
                txt_port.Value           = s.Port;
            }
        }
コード例 #6
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);
            }
        }
コード例 #7
0
ファイル: Form_Setting.cs プロジェクト: dowesw/ZK-Lymytz-V3.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();
             }
         }
     }
 }
コード例 #8
0
 private void txt_login_Leave(object sender, EventArgs e)
 {
     try
     {
         ResetFiche();
         Users u = Recopiew();
         if (Utils.asString(u.Code))
         {
             users = UsersBLL.OneByName(u.Code);
             if (users != null ? users.Id > 0 : false)
             {
                 if (!users.Actif)
                 {
                     if (Messages.Erreur_Retry("Utilisateur Inactif") == System.Windows.Forms.DialogResult.Retry)
                     {
                         txt_login_Leave(sender, e);
                     }
                     return;
                 }
                 com_societe.Enabled = users.AccesMultiSociete;
                 com_agence.Enabled  = users.AccesMultiSociete;
                 if (users.AccesMultiSociete)
                 {
                     if (users.SuperAdmin)
                     {
                         societes = SocieteBLL.List("select y.id, y.name, y.adresse_ip, COALESCE(i.port, 0) AS port, i.users, i.password, i.domain, i.type_connexion, y.groupe, g.libelle " +
                                                    "from yvs_societes y left join yvs_societes_connexion i on i.societe = y.id left join yvs_base_groupe_societe g on y.groupe = g.id ");
                     }
                     else if (users.Agence.Societe.Groupe != null? users.Agence.Societe.Groupe.Id > 0:false)
                     {
                         societes = SocieteBLL.List("select y.id, y.name, y.adresse_ip, COALESCE(i.port, 0) AS port, i.users, i.password, i.domain, i.type_connexion, y.groupe, g.libelle " +
                                                    "from yvs_societes y left join yvs_societes_connexion i on i.societe = y.id left join yvs_base_groupe_societe g on y.groupe = g.id where y.groupe = " + users.Agence.Societe.Groupe.Id);
                     }
                     else
                     {
                         societes.Add(users.Agence.Societe);
                     }
                 }
                 else if (users.AccesMultiAgence)
                 {
                     societes.Add(users.Agence.Societe);
                 }
                 else
                 {
                     agence  = users.Agence;
                     societe = agence.Societe;
                     societes.Add(societe);
                 }
                 if (societes.Count > 0)
                 {
                     LoadSociete(societes);
                 }
             }
             else
             {
                 if (Messages.Erreur_Retry("Utilisateur Incorrect") == System.Windows.Forms.DialogResult.Retry)
                 {
                     txt_login_Leave(sender, e);
                 }
             }
         }
         else
         {
             Messages.ShowErreur("L'identifiant de l'utilisateur ne peut pas être null!");
         }
     }
     catch (Exception ex)
     {
         Messages.Exception(ex);
     }
 }