public void AddClient(Clients client) { DirectorMain.CommitEdit(); db.Clients.Add(client); db.SaveChanges(); DirectorMain.ClearGrid(); DirectorMain.ConstructClienGrid(); }
public void DeleteClient(int index) { DirectorMain.CommitEdit(); db.Clients.Remove(db.Clients.ToList()[index]); db.SaveChanges(); DirectorMain.ClearGrid(); DirectorMain.ConstructClienGrid(); }
public void EditClient(int index, Clients client) { DirectorMain.CommitEdit(); db.Clients.ToList()[index].Surname = client.Surname; db.Clients.ToList()[index].Name = client.Name; db.Clients.ToList()[index].Patronymic = client.Patronymic; db.Clients.ToList()[index].Phone = client.Phone; db.Clients.ToList()[index].Email = client.Email; db.Clients.ToList()[index].Address = client.Address; db.SaveChanges(); DirectorMain.ClearGrid(); DirectorMain.ConstructClientGrid(db.Clients.ToList()); }