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) }); }
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 }); }
public Facture Edit(Facture f) { var db = Mapper.Map<DbFacture>(f); this.connexion.Update(db); return f; }
public Facture Create(Facture f) { var db = Mapper.Map<DbFacture>(f); this.connexion.Insert(db); return f; }