public void Insert(Core.Domain.Tank model) { db = new SqlConnection(ConfigurationManager.ConnectionStrings["cnConsumption"].ConnectionString); string sql = " INSERT INTO tblTank(Name) " + " VALUES (@Name)"; db.Execute(sql, new { model.Name }); db.Close(); }
public void Update(Core.Domain.Tank model) { db = new SqlConnection(ConfigurationManager.ConnectionStrings["cnConsumption"].ConnectionString); string sql = " Update tblBrand Set Name=@Name Where id=@ID"; db.Execute(sql, new { model.Name, model.ID }); db.Close(); }
public ActionResult Add(Core.Domain.Tank model) { _TankService = new TankService(); _TankService.InsertTank(model); return(RedirectToAction("Index")); }
public ActionResult Edit(Core.Domain.Tank Model) { _TankService = new TankService(); _TankService.Update(Model); return(RedirectToAction("Index")); }