예제 #1
0
        // saves the form
        // links:
        //  docLink: http://sql2x.org/documentationLink/c9522930-91f8-4468-a936-8030bb2a6482
        private void buttonSave_Click(object sender, EventArgs e)
        {
            var service = new CrudeFinancialPaymentServiceClient();

            try {
                _contract.FinancialPaymentTypeRcd = financialPaymentTypeRefCombo.Text;
                _contract.UserId = (Guid)userPicker.SelectedValue;

                if (_isNew)
                {
                    service.Insert(_contract);
                }
                else
                {
                    service.Update(_contract);
                }
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }

            Close();
        }
예제 #2
0
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid financialPaymentId)
        {
            var service = new CrudeFinancialPaymentServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByFinancialPaymentId(financialPaymentId);
                financialPaymentTypeRefCombo.Text = _contract.FinancialPaymentTypeRcd != null ? _contract.FinancialPaymentTypeRcd : String.Empty;
                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();
            }
        }
예제 #3
0
        // refresh the grid
        // links:
        //  docLink: http://sql2x.org/documentationLink/a90065e7-8ace-4de7-9367-d4653a7c637f
        public void RefreshCrudeFinancialPayment()
        {
            var financialPayment = new CrudeFinancialPaymentServiceClient();

            try {
                var bindingSource = new BindingSource();
                bindingSource.DataSource = financialPayment.FetchWithFilter(
                    Guid.Empty
                    , financialPaymentTypeRefCombo.Text
                    , Guid.Empty
                    , Guid.Empty
                    , Guid.Empty
                    , Guid.Empty
                    , Guid.Empty
                    , Guid.Empty
                    , Guid.Empty
                    , DateTime.MinValue
                    );
                dataGridViewCrudeFinancialPayment.AutoGenerateColumns = false;
                dataGridViewCrudeFinancialPayment.DataSource          = bindingSource;
                dataGridViewCrudeFinancialPayment.AutoResizeColumns();
                dataGridViewCrudeFinancialPayment.Refresh();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                financialPayment.Close();
            }
        }
예제 #4
0
        public void ShowAsEdit(
            System.Guid financialPaymentId
            )
        {
            var service = new CrudeFinancialPaymentServiceClient();

            _isNew = true;  // to enable page switch

            try {
                _financialPaymentContract = service.FetchByFinancialPaymentId(financialPaymentId);

                // choose tab
                if (_financialPaymentContract.FinancialPaymentTypeRcd.Contains(FinancialPaymentTypeRef.Card))
                {
                    FetchCardDetails(_financialPaymentContract.FinancialPaymentCardId);
                    tabControl.SelectedTab = tabPageCard;
                }
                else if (_financialPaymentContract.FinancialPaymentTypeRcd.Contains(FinancialPaymentTypeRef.Cash))
                {
                    FetchCashDetails(_financialPaymentContract.FinancialPaymentCashId);
                    tabControl.SelectedTab = tabPageCash;
                }
                else if (_financialPaymentContract.FinancialPaymentTypeRcd.Contains(FinancialPaymentTypeRef.Voucher))
                {
                    tabControl.SelectedTab = tabPageVoucher;
                }
                else if (_financialPaymentContract.FinancialPaymentTypeRcd.Contains(FinancialPaymentTypeRef.Bank))
                {
                    FetchBankDetails(_financialPaymentContract.FinancialPaymentBankId);
                    tabControl.SelectedTab = tabPageBank;
                }
                else if (_financialPaymentContract.FinancialPaymentTypeRcd.Contains(FinancialPaymentTypeRef.Accounting))
                {
                    tabControl.SelectedTab = tabPageAccounting;
                }

                buttonPaymentAdd.Enabled = false;

                CashCalc();

                Show();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                service.Close();
            }
            _isNew = false;  // to disable page switch
        }
예제 #5
0
        public ActionResult CrudeFinancialPaymentEdit(
            System.Guid financialPaymentId
            )
        {
            CrudeFinancialPaymentContract contract = new CrudeFinancialPaymentServiceClient().FetchByFinancialPaymentId(financialPaymentId);

            ViewBag.FinancialPaymentTypeRcd =
                new SelectList(new CrudeFinancialPaymentTypeRefServiceClient().FetchAll(),
                               "FinancialPaymentTypeRcd",
                               "FinancialPaymentTypeName",
                               contract.FinancialPaymentTypeRcd
                               );

            ViewBag.FinancialPaymentCardId =
                new SelectList(new CrudeFinancialPaymentCardServiceClient().FetchAll(),
                               "FinancialPaymentCardId",
                               "NameOnCard",
                               contract.FinancialPaymentCardId
                               );

            ViewBag.FinancialPaymentBankId =
                new SelectList(new CrudeFinancialPaymentBankServiceClient().FetchAll(),
                               "FinancialPaymentBankId",
                               "BankName",
                               contract.FinancialPaymentBankId
                               );

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


            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialPayment/CrudeFinancialPaymentEdit.cshtml",
                       contract
                       ));
        }