Exemple #1
0
 public void chargerSociete()
 {
     Application.DoEvents();
     SOCIETE.Clear();
     SOCIETE.Merge(CLIENT_APP_PARAM.gcws.LOAD_CONFIG_SOCIETE());
     bsSociete.DataSource = SOCIETE;
 }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SOCIETE societe = entity.SOCIETE.FirstOrDefault(S => S.CODE_S.Equals((decimal)comboboxSociete.SelectedValue));
                MACHINE Machine = entity.MACHINE.FirstOrDefault(machine => machine.ID_M == machineID);


                Machine.TYPE_M     = cb2.Text;
                Machine.CODE_S     = societe.CODE_S;
                Machine.LIB        = tb1.Text;
                Machine.IP         = tb2.Text;
                Machine.PORT       = Convert.ToDecimal(tb3.Text);
                Machine.PWD        = tb4.Text;
                Machine.ID_LECTEUR = 1;
                // Machine.SOCIETE = societe;



                entity.SaveChanges();


                MessageFormtOK MessageFormtOK = new MessageFormtOK("Modification avec success...");
                var            result         = MessageFormtOK.ShowDialog();

                Close();
            }
            catch (Exception ex)
            {
                MessageFormError MessageForm = new MessageFormError(ex.Message.ToString());
                var result = MessageForm.ShowDialog();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SOCIETE SOCIETE = entity.SOCIETE.FirstOrDefault(societe => societe.CODE_S == fillaleID);


                SOCIETE.NOM_S       = tb2.Text;
                SOCIETE.ADR_S       = tb3.Text;
                SOCIETE.VILLE       = tb4.Text;
                SOCIETE.CODE_POSTAL = Convert.ToDecimal(tb5.Text);
                SOCIETE.TEL_S       = tb6.Text;
                SOCIETE.PAY         = tb7.Text;



                entity.SaveChanges();


                MessageFormtOK MessageFormtOK = new MessageFormtOK("Modification avec success...");
                var            result         = MessageFormtOK.ShowDialog();

                Close();
            }
            catch (Exception ex)
            {
                MessageFormError MessageForm = new MessageFormError(ex.Message.ToString());
                var result = MessageForm.ShowDialog();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SOCIETE societe = entity.SOCIETE.FirstOrDefault(S => S.CODE_S.Equals((decimal)comboboxSociete.SelectedValue));
                MACHINE machine = new MACHINE
                {
                    //  ID_M = Convert.ToDecimal(cb1.Text),
                    TYPE_M     = cb2.Text,
                    CODE_S     = societe.CODE_S,
                    LIB        = tb1.Text,
                    IP         = tb2.Text,
                    PORT       = Convert.ToDecimal(tb3.Text),
                    PWD        = tb4.Text,
                    ID_LECTEUR = 1,
                    SOCIETE    = societe
                };


                entity.MACHINE.Add(machine);
                entity.SaveChanges();

                MessageBox.Show("ajout avec success...");
                MessageFormtOK MessageFormtOK = new MessageFormtOK("ajout avec success...");
                var            result         = MessageFormtOK.ShowDialog();

                Close();
            }
            catch (Exception ex)
            {
                MessageFormError MessageForm = new MessageFormError(ex.Message.ToString());
                var result = MessageForm.ShowDialog();
            }
        }
Exemple #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            SOCIETE societe = entity.SOCIETE.FirstOrDefault(S => S.CODE_S.Equals((decimal)comboBox1.SelectedValue));
            //     var ID = entity.SHIFT.First().CODE;

            SHIFT Shift = entity.SHIFT.FirstOrDefault(shift => shift.CODE == shiftID);


            //    CODE = ID + 1,
            // CODE = 5,
            Shift.LIBELLE         = TextboxLibelle.Text;
            Shift.DATEDDEBUT      = dateTimePicker1.Value;
            Shift.DATEDFIN        = dateTimePicker2.Value;
            Shift.HEUREDEBUT      = dateTimePicker3.Value;
            Shift.HEUREFIN        = dateTimePicker4.Value;
            Shift.HEUREDEBUTPAUSE = dateTimePicker5.Value;
            Shift.HEUREFINPAUSE   = dateTimePicker6.Value;
            Shift.WEEKEND         = checkBoxWeekend.Checked ? 1 : 0;
            Shift.VACANCE         = checkBoxVacances.Checked?1:0;
            Shift.JOURSFERIES     = checkBoxJoursferies.Checked ? 1 : 0;

            Shift.CODE_S  = societe.CODE_S;
            Shift.SOCIETE = societe;



            entity.SaveChanges();
            this.Close();
            MessageFormtOK MessageFormtOK = new MessageFormtOK("modification avec success...");
            var            result         = MessageFormtOK.ShowDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SOCIETE SOCIETE = new SOCIETE
                {
                    NOM_S       = tb2.Text,
                    ADR_S       = tb3.Text,
                    VILLE       = tb4.Text,
                    CODE_POSTAL = Convert.ToDecimal(tb5.Text),
                    TEL_S       = tb6.Text,
                    PAY         = tb7.Text,
                };


                entity.SOCIETE.Add(SOCIETE);
                entity.SaveChanges();


                MessageFormtOK MessageFormtOK = new MessageFormtOK("ajout avec success...");
                var            result         = MessageFormtOK.ShowDialog();

                Close();
            }
            catch (Exception ex)
            {
                MessageFormError MessageForm = new MessageFormError(ex.Message.ToString());
                var result = MessageForm.ShowDialog();
            }
        }
Exemple #7
0
        public ActionResult DeleteConfirmed(short id)
        {
            SOCIETE sOCIETE = db.SOCIETE.Find(id);

            db.SOCIETE.Remove(sOCIETE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #8
0
        public SOCIETE TrouveSociete(short idUtilisateur)
        {
            UTILISATEUR utilisateur = new UTILISATEUR();
            SOCIETE     societe     = new SOCIETE();

            utilisateur = dal.bdd.UTILISATEUR.FirstOrDefault(u => u.ID_UTILISATEUR == idUtilisateur);
            societe     = dal.bdd.SOCIETE.FirstOrDefault(s => s.ID_SOCIETE == utilisateur.ID_SOCIETE);

            return(societe);
        }
Exemple #9
0
 public ActionResult Edit([Bind(Include = "ID_SOCIETE,ID_VILLE,LIBELLE_SOCIETE,LOGO_SOCIETE,NUMSIRET_SOCIETE,NUMINTRA_SOCIETE,TELEPHONE_SOCIETE,FAX_SOCIETE,EMAIL_SOCIETE")] SOCIETE sOCIETE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sOCIETE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID_VILLE = new SelectList(db.VILLE, "ID_VILLE", "NOM_VILLE", sOCIETE.ID_VILLE);
     return(View(sOCIETE));
 }
        public ModifierFiliale(decimal fillaleID)
        {
            InitializeComponent();
            this.fillaleID = fillaleID;
            SOCIETE SOCIETE = entity.SOCIETE.FirstOrDefault(societe => societe.CODE_S == fillaleID);

            tb2.Text = SOCIETE.NOM_S;
            tb3.Text = SOCIETE.ADR_S;
            tb4.Text = SOCIETE.VILLE;
            tb5.Text = SOCIETE.CODE_POSTAL.ToString();;
            tb6.Text = SOCIETE.TEL_S;
            tb7.Text = SOCIETE.PAY;
        }
Exemple #11
0
        // GET: Administration/Societe/Details/5
        public ActionResult Details(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SOCIETE sOCIETE = db.SOCIETE.Find(id);

            if (sOCIETE == null)
            {
                return(HttpNotFound());
            }
            return(View(sOCIETE));
        }
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                string imgpath = img.ImageLocation;



                FileStream   fs      = new FileStream((string)imgpath, FileMode.Open, FileAccess.Read);
                BinaryReader br      = new BinaryReader(fs);
                FileInfo     fi      = new FileInfo((string)imgpath);
                byte[]       imgdata = br.ReadBytes((int)fi.Length);
                fs.Close();
                br.Close();
                SOCIETE societe = entity.SOCIETE.FirstOrDefault(S => S.CODE_S.Equals((decimal)comboBox1.SelectedValue));
                SHIFT   shift   = entity.SHIFT.FirstOrDefault(S => S.CODE == (decimal)comboBox2.SelectedValue);


                PERSONNEL p = new PERSONNEL
                {
                    MAT        = tb1.Text,
                    NOM        = tb2.Text,
                    PRENOM     = tb3.Text,
                    TEL        = tb4.Text,
                    ADR_P      = tb5.Text,
                    VILLE_P    = tb6.Text,
                    POSTE      = tb7.Text,
                    DATE_EMB   = dt.Value,
                    SALAIRE    = Convert.ToDecimal(tb8.Text),
                    PHOTO      = imgdata,
                    CODE_S     = societe.CODE_S,
                    SHIFT      = shift,
                    SOCIETE    = societe,
                    IDEMPRIENT = emprientID
                };

                entity.PERSONNEL.Add(p);
                entity.SaveChanges();
                ajout.ForeColor = Color.Green;
                MessageFormtOK MessageFormtOK = new MessageFormtOK("ajout avec success");
                var            result         = MessageFormtOK.ShowDialog();

                this.Close();
            }//Try end
            catch (Exception ex)
            {
                MessageFormError MessageForm = new MessageFormError(ex.Message.ToString());
                var result = MessageForm.ShowDialog();
            }
        }
Exemple #13
0
        // GET: Administration/Societe/Edit/5
        public ActionResult Edit(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SOCIETE sOCIETE = db.SOCIETE.Find(id);

            if (sOCIETE == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_VILLE = new SelectList(db.VILLE, "ID_VILLE", "NOM_VILLE", sOCIETE.ID_VILLE);
            return(View(sOCIETE));
        }
Exemple #14
0
        // GET: Vendeur/Societe
        public ActionResult Index()
        {
            string  sIdUtilisateur = HttpContext.User.Identity.Name;
            short   shortIdUtilisateur;
            SOCIETE societe = new SOCIETE();

            if (HttpContext.User.Identity.IsAuthenticated)
            {
                if (short.TryParse(sIdUtilisateur, out shortIdUtilisateur))
                {
                    societe = societeModel.TrouveSociete(shortIdUtilisateur);
                }
                else
                {
                    return(Content("Error"));
                }
            }
            return(View(societe));
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SOCIETE societe = entity.SOCIETE.FirstOrDefault(S => S.CODE_S.Equals((decimal)comboBox1.SelectedValue));
                //     var ID = entity.SHIFT.First().CODE;



                SHIFT shift = new SHIFT
                {
                    //    CODE = ID + 1,
                    // CODE = 5,
                    LIBELLE         = TextboxLibelle.Text,
                    DATEDDEBUT      = dateTimePicker1.Value,
                    DATEDFIN        = dateTimePicker2.Value,
                    HEUREDEBUT      = dateTimePicker3.Value,
                    HEUREFIN        = dateTimePicker4.Value,
                    HEUREDEBUTPAUSE = dateTimePicker5.Value,
                    HEUREFINPAUSE   = dateTimePicker6.Value,
                    WEEKEND         = checkBoxWeekend.Checked ? 1 : 0,
                    VACANCE         = checkBoxVacances.Checked ? 1 : 0,
                    JOURSFERIES     = checkBoxJoursferies.Checked ? 1 : 0,

                    CODE_S  = societe.CODE_S,
                    SOCIETE = societe
                };

                entity.SHIFT.Add(shift);
                entity.SaveChanges();
                MessageFormtOK MessageFormtOK = new MessageFormtOK("ajout avec success");
                var            result         = MessageFormtOK.ShowDialog();


                this.Close();
            }
            catch (Exception ex)
            {
                MessageFormError MessageForm = new MessageFormError(ex.Message.ToString());
                var result = MessageForm.ShowDialog();
            }
        }
Exemple #16
0
 public ActionResult Index(SOCIETE societe)
 {
     return(View(societe));
 }