Пример #1
0
        private void LoadAdd()
        {
            if (!string.IsNullOrWhiteSpace(TextBoxCVVText) &&
                !string.IsNullOrWhiteSpace(TextBoxDateBankCardText) &&
                !string.IsNullOrWhiteSpace(TextBoxNameOfBankCardText) &&
                !string.IsNullOrWhiteSpace(TextBoxNumberBankCardText) &&
                !string.IsNullOrWhiteSpace(TextBoxNumberPhoneForAddText) &&
                !string.IsNullOrWhiteSpace(TextBoxSumForAddText))
            {
                addBalance = new BLL.Models.AddBalanceModel()
                {
                    CVVBankCard              = Convert.ToInt32(TextBoxCVVText),
                    idClient                 = idUser,
                    dateBankCard             = Convert.ToDateTime(TextBoxDateBankCardText),
                    nameBankCard             = TextBoxNameOfBankCardText,
                    numberBankCard           = TextBoxNumberBankCardText,
                    phoneNumberForAddBalance = TextBoxNumberPhoneForAddText,
                    SumForAdd                = Convert.ToInt32(TextBoxSumForAddText)
                };
                dbOperation.CreateAddBalance(addBalance);
                dbOperation.UpdateBalanceClient(idUser, Convert.ToInt32(TextBoxSumForAddText));
            }
            else
            {
                LabelErrorAddBalance = "Незаполены поля!";
            }

            //CodeBehind.LoadView(ViewType.Main);
        }