Exemplo n.º 1
0
 public int AddSupplier(Supplier supplier)
 {
     supplier.DateInserted = DateTime.Now;
     supplier.DateUpdeted = DateTime.Now;
     _db.Suppliers.Add(supplier);
     return _db.SaveChanges();
 }
Exemplo n.º 2
0
        public ActionResult Create(Supplier supplier)
        {
            if (ModelState.IsValid)
              {
            _store.AddSupplier(supplier);
            return RedirectToAction("Index");
              }

              return View(supplier);
        }
Exemplo n.º 3
0
 public int UpdateSupplier(Supplier supplier)
 {
     supplier.DateUpdeted = DateTime.Now;
     _db.Entry(supplier).State = EntityState.Modified;
     return _db.SaveChanges();
 }
Exemplo n.º 4
0
 public ActionResult Edit(Supplier supplier)
 {
     if (ModelState.IsValid)
       {
     _store.UpdateSupplier(supplier);
     return RedirectToAction("Index");
       }
       return View(supplier);
 }