Exemplo n.º 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 CrudeFinancialVoucherTypeRefServiceClient();

            try {
                _contract.FinancialVoucherTypeRcd  = textBoxFinancialVoucherType.Text;
                _contract.FinancialVoucherTypeName = textBoxFinancialVoucherTypeName.Text;

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

            Close();
        }
Exemplo n.º 2
0
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(string financialVoucherTypeRcd, System.Guid userId)
        {
            var service = new CrudeFinancialVoucherTypeRefServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByFinancialVoucherTypeRcd(financialVoucherTypeRcd);
                textBoxFinancialVoucherType.Text     = _contract.FinancialVoucherTypeRcd;
                textBoxFinancialVoucherTypeName.Text = _contract.FinancialVoucherTypeName;
                _contract.UserId            = 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();
            }
        }
        // fetch all rows from the SOAP layer and populate the ComboBox with it
        // links:
        //  docLink: http://sql2x.org/documentationLink/4ccfdfd8-9986-4cfe-8743-e0bcde887284
        public void PopulateCombo()
        {
            if (!DesignMode && cboRef.DataSource == null)
            {
                CrudeFinancialVoucherTypeRefServiceClient financialVoucherTypeRef = null;

                try {
                    financialVoucherTypeRef = new CrudeFinancialVoucherTypeRefServiceClient();
                    List <CrudeFinancialVoucherTypeRefContract> contracts = financialVoucherTypeRef.FetchAll();

                    cboRef.DataSource    = contracts;
                    cboRef.DisplayMember = "FinancialVoucherTypeName";
                    cboRef.ValueMember   = "FinancialVoucherTypeRcd";
                } catch (Exception ex) {
                    if (ex != null)
                    {
                    }
                } finally {
                    if (financialVoucherTypeRef != null)
                    {
                        financialVoucherTypeRef.Close();
                    }
                }
            }
        }
        // refresh the grid
        // links:
        //  docLink: http://sql2x.org/documentationLink/a90065e7-8ace-4de7-9367-d4653a7c637f
        public void RefreshCrudeFinancialVoucherTypeRef()
        {
            var financialVoucherTypeRef = new CrudeFinancialVoucherTypeRefServiceClient();

            try {
                var bindingSource = new BindingSource();
                bindingSource.DataSource = financialVoucherTypeRef.FetchWithFilter(
                    textBoxFinancialVoucherType.Text
                    , textBoxFinancialVoucherTypeName.Text
                    , Guid.Empty
                    , DateTime.MinValue
                    );
                dataGridViewCrudeFinancialVoucherTypeRef.AutoGenerateColumns = false;
                dataGridViewCrudeFinancialVoucherTypeRef.DataSource          = bindingSource;
                dataGridViewCrudeFinancialVoucherTypeRef.AutoResizeColumns();
                dataGridViewCrudeFinancialVoucherTypeRef.Refresh();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                financialVoucherTypeRef.Close();
            }
        }
        public ActionResult CrudeFinancialVoucherTypeRefEdit(
            System.String financialVoucherTypeRcd
            )
        {
            CrudeFinancialVoucherTypeRefContract contract = new CrudeFinancialVoucherTypeRefServiceClient().FetchByFinancialVoucherTypeRcd(financialVoucherTypeRcd);

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