Exemplo n.º 1
0
 public Production(TypeMaterial typeMaterial, TypeProduction typeProduction, string name, Size size, int count)
 {
     NameProduction  = name;
     SizeProduction  = size;
     CountProduction = count;
     Material        = typeMaterial;
     Type            = typeProduction;
 }
Exemplo n.º 2
0
        private void btnModifier_Click(object sender, EventArgs e)
        {
            int    codeParametrage = Convert.ToInt32(textcode.Text.Trim());
            string libelle         = textlibelle.Text.Trim();

            //
            // Modifier Livreur
            //
            if (LibelleForm.libelle == "Livreur")
            {
                Livreur liv = db.Livreurs.ToList <DAL.Livreur>().Where(w => w.CodeLivreur == codeParametrage).FirstOrDefault();
                if (liv == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    liv.Libelle = libelle;
                    GenericRepository <Livreur> livr = new GenericRepository <Livreur>(db);
                    livr.Update(liv);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Moyen de Transport
            //
            if (LibelleForm.libelle == "Moyen de Transport")
            {
                MoyenTransport moy = db.MoyenTransports.ToList <DAL.MoyenTransport>().Where(w => w.CodeMoyenTransport == codeParametrage).FirstOrDefault();
                if (moy == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    moy.Libelle = libelle;
                    GenericRepository <MoyenTransport> Moys = new GenericRepository <MoyenTransport>(db);
                    Moys.Update(moy);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Banque
            //

            if (LibelleForm.libelle == "Banque")
            {
                Banque ban = db.Banques.ToList <DAL.Banque>().Where(w => w.CodeBanque == codeParametrage).FirstOrDefault();
                if (ban == null)
                {
                    MessageBox.Show("Enregistrementn'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    ban.Libelle = libelle;
                    GenericRepository <Banque> banques = new GenericRepository <Banque>(db);
                    banques.Update(ban);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Mode de Réglements
            //
            if (LibelleForm.libelle == "Mode de Réglement")
            {
                ModeReglement mode = db.ModeReglements.ToList <DAL.ModeReglement>().Where(w => w.CodeModeReg == codeParametrage).FirstOrDefault();
                if (mode == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    mode.Libelle = libelle;
                    GenericRepository <ModeReglement> modeReg = new GenericRepository <ModeReglement>(db);
                    modeReg.Update(mode);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Type Client
            //
            if (LibelleForm.libelle == "Type Client")
            {
                TypeClient typeCL = db.TypeClients.ToList <DAL.TypeClient>().Where(w => w.CodeTypeClient == codeParametrage).FirstOrDefault();
                if (typeCL == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    typeCL.Libelle = libelle;
                    GenericRepository <TypeClient> typeClient = new GenericRepository <TypeClient>(db);
                    typeClient.Update(typeCL);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Familles
            //
            if (LibelleForm.libelle == "Liste Familles")
            {
                Famille fam = db.Familles.ToList <DAL.Famille>().Where(w => w.CodeFamille == codeParametrage).FirstOrDefault();
                if (fam == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    fam.LibelleFamille = libelle;
                    GenericRepository <Famille> fams = new GenericRepository <Famille>(db);
                    fams.Update(fam);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Type production
            //
            if (LibelleForm.libelle == "Type de Production")
            {
                TypeProduction pro = db.TypeProductions.ToList <DAL.TypeProduction>().Where(w => w.CodeTypeProd == codeParametrage).FirstOrDefault();
                if (pro == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    pro.Libelle = libelle;
                    GenericRepository <TypeProduction> typeprod = new GenericRepository <TypeProduction>(db);
                    typeprod.Update(pro);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Type Comptage
            //
            if (LibelleForm.libelle == "Type de Comptage")
            {
                TypeComptage com = db.TypeComptages.ToList <DAL.TypeComptage>().Where(w => w.CodeTypeCom == codeParametrage).FirstOrDefault();
                if (com == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    com.Libelle = libelle;
                    GenericRepository <TypeComptage> typecom = new GenericRepository <TypeComptage>(db);
                    typecom.Update(com);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Colisage
            //
            if (LibelleForm.libelle == "Colisage")
            {
                Colisage col = db.Colisages.ToList <DAL.Colisage>().Where(w => w.CodeColisage == codeParametrage).FirstOrDefault();
                if (col == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    col.Libelle = libelle;
                    GenericRepository <Colisage> cols = new GenericRepository <Colisage>(db);
                    cols.Update(col);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            //
            //Modifier Unité
            //
            if (LibelleForm.libelle == "Unité")
            {
                Unite uni = db.Unites.ToList <DAL.Unite>().Where(w => w.CodeUnite == codeParametrage).FirstOrDefault();
                if (uni == null)
                {
                    MessageBox.Show("Enregistrement n'existe pas", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    uni.Libelle = libelle;
                    GenericRepository <Unite> unis = new GenericRepository <Unite>(db);
                    unis.Update(uni);
                    MessageBox.Show("Enregistrement modifié avec succès", codeParametrage.ToString() + " " + libelle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            Clear();
            frmCodeLibelle_Load(sender, e);
        }
Exemplo n.º 3
0
 public PrimaryProduction(TypeMaterial typeMaterial, TypeProduction typeProduction, string name, Size size, int count, decimal price)
     : base(name, size, count, price)
 {
     Material = typeMaterial;
     Type     = typeProduction;
 }