public ActionResult Edite(Trans_CustomerViewModel obj) { var row = db.Trans_Customer.Find(obj.id); row.total = obj.total; row.cash = obj.cash; row.reminder = obj.total - obj.cash; row.notes = obj.notes; row.date = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(Trans_CustomerViewModel obj) { Trans_Customer c = new Trans_Customer(); c.customer_id = obj.customer_id; c.total = obj.total; c.cash = obj.cash; c.reminder = obj.total - obj.cash; c.notes = obj.notes; c.date = DateTime.Now; db.Trans_Customer.Add(c); db.SaveChanges(); return(RedirectToAction("Index")); }