public void Delete(int ID) { Nastroiki pac = db8.Nastroiki.Where(c => c.ID == ID).FirstOrDefault(); db8.Nastroiki.DeleteOnSubmit(pac); db8.SubmitChanges(); }
public void ADD(string login, string pass) { Nastroiki pac = new Nastroiki(); pac.login = login; pac.pass = pass; db8.Nastroiki.InsertOnSubmit(pac); db8.SubmitChanges(); }
public void Edit(int ID, string login, string pass) { try { Nastroiki pac = db8.Nastroiki.Where(c => c.ID == ID).FirstOrDefault(); pac.login = login; pac.pass = pass; db8.SubmitChanges(); } catch (NullReferenceException) { Nastroiki pac = new Nastroiki(); pac.ID = ID; pac.login = login; pac.pass = pass; db8.Nastroiki.InsertOnSubmit(pac); db8.SubmitChanges(); } }