Beispiel #1
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TbCode.Text))
            {
                return;
            }

            if (!EmailsValidate())
            {
                LblInfo.Content = Properties.Resources.NO_VALID_EMAIL_FORMAT;
                return;
            }

            var customer = new Customers(Convert.ToInt32(TbCode.Text), TbName.Text, TbEmail1.Text, TbEmail2.Text, TbEmail3.Text);

            if (_myCustomersManager.Exists(customer))
            {
                _myCustomersManager.Update(customer);
            }
            else
            {
                _myCustomersManager.Create(customer);
            }

            LblInfo.Content = Properties.Resources.CORRECT_SAVE;

            ControlsClear();
        }