public ActionResult CrudeFinancialOrderCreate([Bind()] CrudeFinancialOrderContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeFinancialOrderServiceClient().Insert(contract);

                return(RedirectToAction("CrudeFinancialOrderIndex"));
            }

            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialOrder/CrudeFinancialOrderCreate.cshtml",
                       contract
                       ));
        }
        public ActionResult CrudeFinancialOrderEdit([Bind()] CrudeFinancialOrderContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeFinancialOrderServiceClient().Update(contract);

                return(RedirectToAction("CrudeFinancialOrderIndex"));
            }

            return(View(
                       "~/Views/Crude/Financial/CrudeFinancialOrder/CrudeFinancialOrderEdit.cshtml",
                       contract
                       ));
        }
Exemplo n.º 3
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 CrudeFinancialOrderContract();
         _isNew     = true;
         this.Text += " - Not Savable (User,FinancialCurrency,Client Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
Exemplo n.º 4
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByClient(System.Guid clientId)
        {
            try {
                _contract                   = new CrudeFinancialOrderContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ClientId          = clientId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Exemplo n.º 5
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByFinancialOrderSource(string financialOrderSourceRcd)
        {
            try {
                _contract                         = new CrudeFinancialOrderContract();
                _isNew                            = true;
                _contract.DateTime                = DateTime.UtcNow;
                dateTimePickerDateTime.Text       = _contract.DateTime.ToString();
                _contract.FinancialOrderSourceRcd = financialOrderSourceRcd;
                textBoxFinancialOrderSource.Text  = _contract.FinancialOrderSourceRcd;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
        public ActionResult CrudeFinancialOrderCreate(System.Guid?userId, System.Guid?locationAddressId, System.Guid?financialCurrencyId, System.Guid?clientId)
        {
            var contract = new CrudeFinancialOrderContract();

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

            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/CrudeFinancialOrder/CrudeFinancialOrderCreate.cshtml",
                       contract
                       ));
        }