Exemple #1
0
 public static Depot getAjoutDepot(Depot a)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         string insert = "";
         NpgsqlCommand cmd = new NpgsqlCommand(insert, con);
         cmd.ExecuteNonQuery();
         a.Id = getCurrent();
         return a;
     }
     catch
     {
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
Exemple #2
0
 public static List<Depot> getListDepot(String query)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         List<Depot> l = new List<Depot>();
         NpgsqlCommand Lcmd = new NpgsqlCommand(query, con);
         NpgsqlDataReader lect = Lcmd.ExecuteReader();
         if (lect.HasRows)
         {
             while (lect.Read())
             {
                 Depot a = new Depot();
                 a.Id = Convert.ToInt64(lect["id"].ToString());
                 a.Abbreviation = lect["abbreviation"].ToString();
                 a.Designation = lect["designation"].ToString();
                 a.Emplacements = BLL.EmplacementBll.Liste("select * from yvs_base_emplacement_depot where depot = " + a.Id);
                 a.Articles = BLL.ArticleDepotBll.Liste("select * from yvs_base_article_depot where depot = " + a.Id);
                 a.Mouvements = BLL.MouvementStockBll.Liste("select * from yvs_base_mouvement_stock where date_doc = '" + Constantes.Entete.DateEntete + "' and depot = " + a.Id);
                 a.Update = true;
                 l.Add(a);
             }
             lect.Close();
         }
         return l;
     }
     catch (NpgsqlException e)
     {
         Messages.Exception(e);
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
        private List<FamilleArticle> prodListFamille()
        {
            FamilleArticle Dflt = new FamilleArticle(0);
            Dflt.Description = "Articles sans réel famille";
            Dflt.Designation = "Autres";
            List<FamilleArticle> listInter = new List<FamilleArticle> { Dflt };

            List<Article> articless = new List<Article>();
            dpt = TOOLS.Constantes.Creneau.Depot;

            foreach (ArticleDepot arDpt in dpt.Articles)
            {
                articless.Add(arDpt.Article);
            }

            foreach (Article arT in articless)
            {
                if (arT.Famille.Id > 0)
                {
                    if (!listInter.Contains(arT.Famille))
                    {
                        FamilleArticle f = BLL.FamilleArticleBll.One_(arT.Famille.Id);
                        f.Articles.Add(arT);
                        listInter.Add(f);
                    }
                    else
                    {
                        FamilleArticle f = listInter.Find(x => x.Id == arT.Famille.Id);
                        f.Articles.Add(arT);
                        listInter[listInter.FindIndex(x => x.Id == f.Id)] = f;
                    }
                }
                else
                {
                    FamilleArticle f = listInter.Find(x => x.Id == Dflt.Id);
                    f.Articles.Add(arT);
                    listInter[listInter.FindIndex(x => x.Id == f.Id)] = f;
                }
            }
            return listInter;
        }
        private void NvoTicket_Click(object sender, EventArgs e)
        {
            contenu = new Contenu();

            InitButton(buttonAs, labelAs);
            initZonePrix();
            clientZero = BLL.ClientBll.Default();
            dataGridView1.Rows.Clear();
            picClient.Enabled = true;
            btnEnregistrer.Enabled = true;
            archive = false;
            fact = new Facture();
            fact.TypeDoc = Constantes.TYPE_FV;
            fact.Statut = Constantes.ETAT_EN_ATTENTE;
            fact.Client = BLL.ClientBll.Default();
            fact.Categorie = fact.Client.Categorie;
            fact.HeureDoc = DateTime.Now;
            fact.MouvStock = true;

            com_typeDoc.Text = "Facture";
            SetStateFacture(true);
            configFacture(null);
            clientZero = BLL.ClientBll.Default();
            dpt = TOOLS.Constantes.Creneau.Depot;
            indTabF = 0; indTabA = 0;
            // création de la liste des boutons famille
            buttonFs = new List<Button> { button7, button8, button9, button10, button11, button12, button13, button14 };
            // création de la liste des labels famille
            labelFs = new List<Label> { lbl1, lbl2, lbl3, lbl4, lbl5, lbl6, lbl7, lbl8 };

            // création de la liste des boutons article
            buttonAs = new List<Button> { button15, button16, button17, button18, button19, button20, button21, button22 };
            // création de la liste des labels article
            labelAs = new List<Label> { label18, label20, label21, label22, label23, label24, label25, label26 };
            //lise datagridviews
            datagrids = new List<DataGridView> { dgv_commande, dgv_facture_cours, dgv_facture_regle, dgv_facture_wait, dgv_reglement };
            InitButton(buttonFs, labelFs);
            InitButton(buttonAs, labelAs);
            initZonePrix();
            InitInfoClient();
        }
        public void ConfigForm()
        {
            this.Text = Constantes.APP_NAME + " : Principal";

            Timer bg = new Timer();
            bg.Tick += (s, e) => { lb_date.Text = DateTime.Now.ToString("U"); };
            bg.Interval = 500;
            bg.Start();

            familles.Clear();

            familles = prodListFamille();

            ResetFicheFacture();
            clientZero = BLL.ClientBll.Default();
            dpt = TOOLS.Constantes.Creneau.Depot;
            indTabF = 0; indTabA = 0;
            // création de la liste des boutons famille
            buttonFs = new List<Button> { button7, button8, button9, button10, button11, button12, button13, button14 };
            // création de la liste des labels famille
            labelFs = new List<Label> { lbl1, lbl2, lbl3, lbl4, lbl5, lbl6, lbl7, lbl8 };

            // création de la liste des boutons article
            buttonAs = new List<Button> { button15, button16, button17, button18, button19, button20, button21, button22 };
            // création de la liste des labels article
            labelAs = new List<Label> { label18, label20, label21, label22, label23, label24, label25, label26 };
            //lise datagridviews
            datagrids = new List<DataGridView> { dgv_commande, dgv_facture_cours, dgv_facture_regle, dgv_facture_wait, dgv_reglement };
            InitButton(buttonFs, labelFs);
            InitButton(buttonAs, labelAs);
            initZonePrix();
            InitInfoClient();

            nbrPgF = ((familles.Count % 8) > 0) ? (familles.Count / 8) + 1 : (familles.Count / 8);
            btn_cpt_Famille.Text = "0/" + nbrPgF;

            InitFamille();
        }
Exemple #6
0
 public static bool getUpdateDepot(Depot a)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         string update = "";
         NpgsqlCommand Ucmd = new NpgsqlCommand(update, con);
         Ucmd.ExecuteNonQuery();
         return true;
     }
     catch (Exception e)
     {
         Messages.Exception(e);
         return false;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
        private void configForm()
        {
            depot = Constantes.Creneau.Depot;
            this.Text = Constantes.APP_NAME + " : Principal";

            lb_numPiece.Text = Utils.GenererReference(Constantes.DOC_FACTURE);
            lb_nom_agence.Text = Constantes.Agence.Designation;
            lb_nom_user.Text = Constantes.Users.NomUser;
            box_user.Image = Constantes.Users.Image;
            lb_nom_depot.Text = depot.Designation;
            lb_heure_debut_tranch.Text = Constantes.Creneau.Tranche.HeureDebut.ToString("T");
            lb_heure_fin_tranch.Text = Constantes.Creneau.Tranche.HeureFin.ToString("T");

            Timer timer1 = new Timer();
            timer1.Tick += (s, e) => { lb_date.Text = DateTime.Now.ToString("U"); };
            timer1.Interval = 100;
            timer1.Start();

            DataGridViewImageColumn icon = new DataGridViewImageColumn();
            icon.Name = "mouv";
            icon.HeaderText = "";
            icon.Width = 50;
            dgv_contenu.Columns.Insert(1, icon);
        }
 private void btn_actualise_Click(object sender, EventArgs e)
 {
     Constantes.Creneau.Depot = BLL.DepotBll.One(Constantes.Creneau.Depot.Id);
     depot = Constantes.Creneau.Depot;
     LoadAllArticle();
     ResetFicheContenu();
 }
Exemple #9
0
 public DepotBll(Depot unDepot)
 {
     depot = unDepot;
 }