public string Add(systems newSystem) { string ret = ""; db.systems.Add(newSystem); return(ret); }
public string Delete(string systemId) { string ret; systems deleteSystem = getById(systemId); ret = Delete(deleteSystem); return(ret); }
public string Delete(systems deleteSystem) { string ret = ""; db.Entry(deleteSystem).State = EntityState.Deleted; // need save changes return(ret); }
public string Update(systems updateSystem) { string ret = ""; var aSystem = db.systems.SingleOrDefault(x => x.systemId == updateSystem.systemId); if (aSystem != null) { aSystem = reflectionUtl.assign <systems, systems>( aSystem, updateSystem); db.Entry(aSystem).State = EntityState.Modified; } else { throw new Exception($"system {updateSystem.systemId}" + $" not found"); } return(ret); }
public systemEditViewModel() { editModel = new systems(); }