Esempio n. 1
0
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid financialPaymentBankId)
        {
            var service = new CrudeFinancialPaymentBankServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByFinancialPaymentBankId(financialPaymentBankId);
                financialBankAccountNumberTypeRefCombo.Text = _contract.FinancialBankAccountNumberTypeRcd != null ? _contract.FinancialBankAccountNumberTypeRcd : String.Empty;
                textBoxBankName.Text     = _contract.BankName;
                textBoxBankAccount.Text  = _contract.BankAccount;
                textBoxBankNumber.Text   = _contract.BankNumber;
                maskedTextBoxAmount.Text = _contract.Amount.ToString();
                financialCurrencyPicker.SelectedValue = _contract.FinancialCurrencyId;
                userPicker.SelectedValue    = _contract.UserId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
Esempio n. 2
0
        public void FetchBankDetails(
            System.Guid financialPaymentBankId
            )
        {
            var service = new CrudeFinancialPaymentBankServiceClient();

            try {
                CrudeFinancialPaymentBankContract contract = service.FetchByFinancialPaymentBankId(financialPaymentBankId);
                _financialCurrencyId = contract.FinancialCurrencyId;

                maskedTextBoxPaymentAmount.Text = contract.Amount.ToString();
                financialCurrencyPickerPayment.SelectedValue = contract.FinancialCurrencyId;

                financialBankAccountNumberTypeRefCombo.Text = contract.FinancialBankAccountNumberTypeRcd != null ? contract.FinancialBankAccountNumberTypeRcd : String.Empty;
                textBoxBankName.Text    = contract.BankName;
                textBoxBankAccount.Text = contract.BankAccount;
                textBoxBankNumber.Text  = contract.BankNumber;

                Show();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                service.Close();
            }
        }
Esempio n. 3
0
        // shows the form with default values for comboboxes and pickers
        // links:
        //  docLink: http://sql2x.org/documentationLink/f5685d96-a0bb-4f7b-beaa-b3d578c7cf28
        public void ShowAsAdd(string financialBankAccountNumberTypeRcd, string bankName, string bankAccount, string bankNumber, decimal amount, System.Guid financialCurrencyId, System.Guid userId)
        {
            try {
                _contract = new CrudeFinancialPaymentBankContract();
                _isNew    = true;
                _contract.FinancialBankAccountNumberTypeRcd = financialBankAccountNumberTypeRcd;
                financialBankAccountNumberTypeRefCombo.Text = _contract.FinancialBankAccountNumberTypeRcd != null ? _contract.FinancialBankAccountNumberTypeRcd : String.Empty;
                _contract.BankName                    = bankName;
                textBoxBankName.Text                  = _contract.BankName;
                _contract.BankAccount                 = bankAccount;
                textBoxBankAccount.Text               = _contract.BankAccount;
                _contract.BankNumber                  = bankNumber;
                textBoxBankNumber.Text                = _contract.BankNumber;
                _contract.Amount                      = amount;
                maskedTextBoxAmount.Text              = _contract.Amount.ToString();
                _contract.FinancialCurrencyId         = financialCurrencyId;
                financialCurrencyPicker.SelectedValue = _contract.FinancialCurrencyId;
                _contract.UserId                      = userId;
                userPicker.SelectedValue              = userId;
                _contract.DateTime                    = DateTime.UtcNow;
                dateTimePickerDateTime.Text           = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Esempio n. 4
0
        bool PayWithBank()
        {
            var bankContract = new CrudeFinancialPaymentBankContract();

            // Financial Bank Account Number Type
            bankContract.FinancialBankAccountNumberTypeRcd = financialBankAccountNumberTypeRefCombo.Text;
            if (string.IsNullOrEmpty(bankContract.FinancialBankAccountNumberTypeRcd))
            {
                financialBankAccountNumberTypeRefCombo.Focus();
                MessageBox.Show("Financial Bank Account Number Type Missing");
                return(false);
            }

            // Bank Name
            bankContract.BankName = textBoxBankName.Text;
            if (string.IsNullOrEmpty(bankContract.BankName))
            {
                textBoxBankName.Focus();
                MessageBox.Show("Bank Name Missing");
                return(false);
            }

            // Bank Account
            bankContract.BankAccount = textBoxBankAccount.Text;
            if (string.IsNullOrEmpty(bankContract.BankAccount))
            {
                textBoxBankAccount.Focus();
                MessageBox.Show("Bank Account Missing");
                return(false);
            }

            // Bank Number Missing
            bankContract.BankNumber = textBoxBankNumber.Text;
            if (string.IsNullOrEmpty(bankContract.BankNumber))
            {
                textBoxBankNumber.Focus();
                MessageBox.Show("Bank Number Missing");
                return(false);
            }

            new BookingServiceClient()
            .PaymentBankAdd(
                _bookingId,
                _paymentAmountInBookingCurrency,
                _roundingAmountInBookingCurrency,
                ( Guid )financialCurrencyPickerBookingBalance.SelectedValue,
                _paymentAmountInBookingCurrency,
                _roundingAmountInBookingCurrency,
                ( Guid )financialCurrencyPickerBookingBalance.SelectedValue,
                bankContract.FinancialBankAccountNumberTypeRcd,
                bankContract.BankName,
                bankContract.BankAccount,
                bankContract.BankNumber,
                _financialCostcentreId,
                _financialPaymentContract.UserId
                );

            return(true);
        }
        public ActionResult CrudeFinancialPaymentBankCreate([Bind()] CrudeFinancialPaymentBankContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeFinancialPaymentBankServiceClient().Insert(contract);

                return(RedirectToAction("CrudeFinancialPaymentBankIndex"));
            }

            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialPaymentBank/CrudeFinancialPaymentBankCreate.cshtml",
                       contract
                       ));
        }
        public ActionResult CrudeFinancialPaymentBankEdit([Bind()] CrudeFinancialPaymentBankContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeFinancialPaymentBankServiceClient().Update(contract);

                return(RedirectToAction("CrudeFinancialPaymentBankIndex"));
            }

            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialPaymentBank/CrudeFinancialPaymentBankEdit.cshtml",
                       contract
                       ));
        }
Esempio n. 7
0
 // shows the form with default values for comboboxes and pickers
 // links:
 //  docLink: http://sql2x.org/documentationLink/e04d0806-55ef-41cc-8669-acf0ddd850c7
 public void ShowAsAdd()
 {
     try {
         _contract = new CrudeFinancialPaymentBankContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeFinancialPaymentBankCreate(System.Guid?financialCurrencyId, System.Guid?userId)
        {
            var contract = new CrudeFinancialPaymentBankContract();

            if (financialCurrencyId != null)
            {
                contract.FinancialCurrencyId = (System.Guid)financialCurrencyId;
            }
            if (userId != null)
            {
                contract.UserId = (System.Guid)userId;
            }

            ViewBag.FinancialBankAccountNumberTypeRcd =
                new SelectList(new CrudeFinancialBankAccountNumberTypeRefServiceClient().FetchAll(),
                               "FinancialBankAccountNumberTypeRcd",
                               "FinancialBankAccountNumberTypeName",
                               contract.FinancialBankAccountNumberTypeRcd
                               );

            ViewBag.FinancialCurrencyId =
                new SelectList(new CrudeFinancialCurrencyServiceClient().FetchAll(),
                               "FinancialCurrencyId",
                               "FinancialCurrencyTypeName",
                               contract.FinancialCurrencyId
                               );

            if (userId == null)
            {
                contract.UserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}");
            }

            ViewBag.DefaultUserName =
                new CrudeDefaultUserServiceClient().FetchByDefaultUserId(contract.UserId).DefaultUserName;

            contract.DateTime = DateTime.UtcNow;


            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialPaymentBank/CrudeFinancialPaymentBankCreate.cshtml",
                       contract
                       ));
        }
Esempio n. 9
0
        // shows the form with default values for comboboxes and pickers
        // links:
        //  docLink: http://sql2x.org/documentationLink/599dcb45-f71b-4672-bb18-46975a4fe9b3
        public void ShowAsAddByRules(System.Guid userId)
        {
            try {
                _contract                   = new CrudeFinancialPaymentBankContract();
                _isNew                      = true;
                _contract.UserId            = userId;
                userPicker.SelectedValue    = _contract.UserId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Esempio n. 10
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFinancialBankAccountNumberTypeAndBankAccount(string financialBankAccountNumberTypeRcd, string bankAccount)
        {
            try {
                _contract                   = new CrudeFinancialPaymentBankContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.FinancialBankAccountNumberTypeRcd = financialBankAccountNumberTypeRcd;
                financialBankAccountNumberTypeRefCombo.Text = _contract.FinancialBankAccountNumberTypeRcd != null ? _contract.FinancialBankAccountNumberTypeRcd : String.Empty;
                _contract.BankAccount   = bankAccount;
                textBoxBankAccount.Text = _contract.BankAccount;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }