Ejemplo n.º 1
0
        void view_AddClientClicked(object sender, EventArgs e)
        {
            string   name      = view.NameClient;
            string   lastName  = view.LastNameClient;
            DateTime birthday  = view.Birthday;
            string   email     = view.Email;
            string   telephone = view.Telephone;

            if (string.IsNullOrEmpty(name) || string.IsNullOrWhiteSpace(name) ||
                string.IsNullOrEmpty(lastName) || string.IsNullOrWhiteSpace(lastName) ||
                string.IsNullOrEmpty(telephone) || string.IsNullOrWhiteSpace(telephone)
                )
            {
                messager.ErrorMessage(string.Format("Ошибка добавления клиента!{0}{0}Необходимо заполнить обязательные поля формы помеченные символом \"*\".",
                                                    Environment.NewLine
                                                    ));

                return;
            }

            Client newClient = new Client(name, lastName, birthday, email, telephone);

            clientManager.AddNewClient(newClient, view.Group);

            view.RefreshForm();
        }