Exemplo 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 financialVoucherId)
        {
            var service = new CrudeFinancialVoucherServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByFinancialVoucherId(financialVoucherId);
                financialVoucherTypeRefCombo.Text        = _contract.FinancialVoucherTypeRcd != null ? _contract.FinancialVoucherTypeRcd : String.Empty;
                maskedTextBoxVoucherNumber.Text          = _contract.VoucherNumber.ToString();
                textBoxVoucherDescription.Text           = _contract.VoucherDescription;
                maskedTextBoxValueAmount.Text            = _contract.ValueAmount.ToString();
                financialCurrencyPicker.SelectedValue    = _contract.FinancialCurrencyId;
                dateTimePickerValidFromDateTime.Value    = _contract.ValidFromDateTime != DateTime.MinValue ? _contract.ValidFromDateTime : dateTimePickerValidFromDateTime.MinDate;
                dateTimePickerValidFromDateTime.Checked  = _contract.ValidFromDateTime != DateTime.MinValue;
                dateTimePickerValidUntilDateTime.Value   = _contract.ValidUntilDateTime != DateTime.MinValue ? _contract.ValidUntilDateTime : dateTimePickerValidUntilDateTime.MinDate;
                dateTimePickerValidUntilDateTime.Checked = _contract.ValidUntilDateTime != DateTime.MinValue;
                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();
            }
        }
        public ActionResult CrudeFinancialVoucherCreate([Bind()] CrudeFinancialVoucherContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeFinancialVoucherServiceClient().Insert(contract);

                return(RedirectToAction("CrudeFinancialVoucherIndex"));
            }

            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialVoucher/CrudeFinancialVoucherCreate.cshtml",
                       contract
                       ));
        }
        public ActionResult CrudeFinancialVoucherEdit([Bind()] CrudeFinancialVoucherContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeFinancialVoucherServiceClient().Update(contract);

                return(RedirectToAction("CrudeFinancialVoucherIndex"));
            }

            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialVoucher/CrudeFinancialVoucherEdit.cshtml",
                       contract
                       ));
        }
Exemplo n.º 4
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 CrudeFinancialVoucherContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeFinancialVoucherCreate(System.Guid?financialCurrencyId, System.Guid?userId)
        {
            var contract = new CrudeFinancialVoucherContract();

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

            ViewBag.FinancialVoucherTypeRcd =
                new SelectList(new CrudeFinancialVoucherTypeRefServiceClient().FetchAll(),
                               "FinancialVoucherTypeRcd",
                               "FinancialVoucherTypeName",
                               contract.FinancialVoucherTypeRcd
                               );

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

            contract.ValidFromDateTime = DateTime.UtcNow;

            contract.ValidUntilDateTime = DateTime.UtcNow;

            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/CrudeFinancialVoucher/CrudeFinancialVoucherCreate.cshtml",
                       contract
                       ));
        }
Exemplo n.º 6
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFinancialCurrency(System.Guid financialCurrencyId)
        {
            try {
                _contract                             = new CrudeFinancialVoucherContract();
                _isNew                                = true;
                _contract.DateTime                    = DateTime.UtcNow;
                dateTimePickerDateTime.Text           = _contract.DateTime.ToString();
                _contract.FinancialCurrencyId         = financialCurrencyId;
                financialCurrencyPicker.SelectedValue = _contract.FinancialCurrencyId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Exemplo n.º 7
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFinancialVoucherType(string financialVoucherTypeRcd)
        {
            try {
                _contract                         = new CrudeFinancialVoucherContract();
                _isNew                            = true;
                _contract.DateTime                = DateTime.UtcNow;
                dateTimePickerDateTime.Text       = _contract.DateTime.ToString();
                _contract.FinancialVoucherTypeRcd = financialVoucherTypeRcd;
                financialVoucherTypeRefCombo.Text = _contract.FinancialVoucherTypeRcd != null ? _contract.FinancialVoucherTypeRcd : String.Empty;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Exemplo n.º 8
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 financialVoucherTypeRcd, int voucherNumber, string voucherDescription, decimal valueAmount, System.Guid financialCurrencyId, System.DateTime validFromDateTime, System.DateTime validUntilDateTime, System.Guid userId)
        {
            try {
                _contract = new CrudeFinancialVoucherContract();
                _isNew    = true;
                _contract.FinancialVoucherTypeRcd        = financialVoucherTypeRcd;
                financialVoucherTypeRefCombo.Text        = _contract.FinancialVoucherTypeRcd != null ? _contract.FinancialVoucherTypeRcd : String.Empty;
                _contract.VoucherNumber                  = voucherNumber;
                maskedTextBoxVoucherNumber.Text          = _contract.VoucherNumber.ToString();
                _contract.VoucherDescription             = voucherDescription;
                textBoxVoucherDescription.Text           = _contract.VoucherDescription;
                _contract.ValueAmount                    = valueAmount;
                maskedTextBoxValueAmount.Text            = _contract.ValueAmount.ToString();
                _contract.FinancialCurrencyId            = financialCurrencyId;
                financialCurrencyPicker.SelectedValue    = _contract.FinancialCurrencyId;
                _contract.ValidFromDateTime              = validFromDateTime;
                dateTimePickerValidFromDateTime.Value    = _contract.ValidFromDateTime != DateTime.MinValue ? _contract.ValidFromDateTime : dateTimePickerValidFromDateTime.MinDate;
                dateTimePickerValidFromDateTime.Checked  = _contract.ValidFromDateTime != DateTime.MinValue;
                _contract.ValidUntilDateTime             = validUntilDateTime;
                dateTimePickerValidUntilDateTime.Value   = _contract.ValidUntilDateTime != DateTime.MinValue ? _contract.ValidUntilDateTime : dateTimePickerValidUntilDateTime.MinDate;
                dateTimePickerValidUntilDateTime.Checked = _contract.ValidUntilDateTime != DateTime.MinValue;
                _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();
                }
            }
        }