Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            Client temp = new Client(textBoxFio.Text, textBoxPhoneNumber.Text);

            clientLogic.Add(temp);
        }
Ejemplo n.º 3
0
 public ActionResult Add(Client client)
 {
     _clientlogic.Add(client);
     return(RedirectToAction("Index"));
 }