Ejemplo n.º 1
0
        private void BtnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TbCode.Text))
            {
                return;
            }

            var cliente = new Customers(Convert.ToInt32(TbCode.Text), TbName.Text, "", "", "");

            if (!_myCustomersManager.ItHasBills(cliente))
            {
                _myCustomersManager.Delete(cliente);
                LblInfo.Content = Properties.Resources.CORRECT_DELETE;
            }
            else
            {
                LblInfo.Content = Properties.Resources.NO_POSIBLE_DELETE_CUSTOMER;
            }

            ControlsClear();
        }