private void btnAddClient_Click(object sender, EventArgs e) { if (int.TryParse(textBoxAddIdCoach.Text, out int idcoach) != false) { Client Client = new Client() { FirstName = textAddFirstNameClient.Text, LastName = textBoxAddLastNameClient.Text, MiddleName = textBoxAddMiddleNameClient.Text, IDCoach = idcoach }; string AddClient = clientlogic.Add(Client); var ClientGetDataBase = clientlogic.GetAll(); _gridClient(ClientGetDataBase); CallBackForm callbackMessage = new CallBackForm(); callbackMessage.ErrorMessage = AddClient; callbackMessage.Show(); } else { CallBackForm callbackMessage = new CallBackForm(); callbackMessage.ErrorMessage = "Введен не корректный ID"; callbackMessage.Show(); } }
private void btn_Add_Click(object sender, EventArgs e) { Client temp = new Client(textBoxFio.Text, textBoxPhoneNumber.Text); clientLogic.Add(temp); }
public ActionResult Add(Client client) { _clientlogic.Add(client); return(RedirectToAction("Index")); }