public override void AddRow() { using (Model.BaseContext db = new Model.BaseContext()) { if (Services != null && !Services.Any <Model.Services>(p => p.Name == NewServiceRow)) { NewRow.Service = Services.Single(p => p.Name == NewServiceRow).Id; } else { db.Services.Add(new Model.Services() { Name = NewServiceRow }); db.SaveChanges(); UploadData(); NewRow.Id = Services.Single <Model.Services>(p => p.Name == NewServiceRow).Id; } db.CartridgeRefillingDetails.Add(NewRow); db.SaveChanges(); } }
public override void AddRow() { using (Model.BaseContext db = new Model.BaseContext()) { db.Devices.Add(NewRow); db.SaveChanges(); } }
public override void AddRow() { using (Model.BaseContext db = new Model.BaseContext()) { db.CartridgeRefillingReports.Add(NewRow); db.SaveChanges(); } }
public override void DeleteRow(object obj) { Model.Devices device = obj as Model.Devices; using (Model.BaseContext db = new Model.BaseContext()) { db.Devices.Remove(db.Devices.Find(device.InventoryId)); db.SaveChanges(); } }
public override void DeleteRow(object obj) { Model.CartridgeRefillingDetails dRow = (obj as Model.CartridgeRefillingDetails); using (Model.BaseContext db = new Model.BaseContext()) { db.CartridgeRefillingDetails.Remove(db.CartridgeRefillingDetails.Find(dRow.Id)); db.SaveChanges(); } }
public override void DeleteRow(object obj) { Model.Locations locations = obj as Model.Locations; using (Model.BaseContext db = new Model.BaseContext()) { db.Locations.Remove(db.Locations.Find(locations.Id)); db.SaveChanges(); } }
public override void DeleteRow(object obj) { Model.CartridgeRefillingReports row = obj as Model.CartridgeRefillingReports; using (Model.BaseContext db = new Model.BaseContext()) { db.CartridgeRefillingReports.Remove(db.CartridgeRefillingReports.Find(row.Id)); db.SaveChanges(); } }
public override void DeleteRow(object obj) { Model.MainLog mainLog = obj as Model.MainLog; using (Model.BaseContext db = new Model.BaseContext()) { db.MainLog.Remove(db.MainLog.Find(mainLog.Id)); db.SaveChanges(); } }
public override void DeleteRow(object obj) { Model.Cartridges cartridge = (obj as Model.Cartridges); using (Model.BaseContext db = new Model.BaseContext()) { db.Cartridges.Remove(db.Cartridges.Find(cartridge.Id)); db.SaveChanges(); } UploadData(); }