Exemplo n.º 1
0
        public ActionResult Create(Facture f)
        {
            if (ModelState.IsValid)
            {
                f.MajLe = DateTime.Now;
                f.MajPar = "PixIT";
                db.Factures.Create(f);
            }

            return RedirectToAction("Index", new { qf = string.Format("{0}-{1}", f.Agence_ID, f.Numero) });
        }
Exemplo n.º 2
0
        public ActionResult Edit(Facture f)
        {
            if (ModelState.IsValid)
            {
                var facture = db.Factures.Get(f.Facture_ID);
                if (f.EstEnvoyee)
                {
                    facture.EstEnvoyee = true;
                    facture.Motif = "CANCEL: " + f.Motif;
                    facture.EnvoiLe = DateTime.Now;
                }
                else
                {
                    facture.EstEnvoyee = false;
                }
                facture.MajLe = DateTime.Now;
                facture.MajPar = "PixIT";
                db.Factures.Edit(facture);
            }

            return RedirectToAction("Details", new { id = f.Facture_ID });
        }
Exemplo n.º 3
0
        public Facture Edit(Facture f)
        {
            var db = Mapper.Map<DbFacture>(f);
            this.connexion.Update(db);

            return f;
        }
Exemplo n.º 4
0
        public Facture Create(Facture f)
        {
            var db = Mapper.Map<DbFacture>(f);
            this.connexion.Insert(db);

            return f;
        }