Example #1
0
        public ActionResult CrudeDefaultRuleCreate(System.Guid?defaultUserId)
        {
            var contract = new CrudeDefaultRuleContract();

            if (defaultUserId != null)
            {
                contract.DefaultUserId = (System.Guid)defaultUserId;
            }

            ViewBag.DefaultRuleTypeRcd =
                new SelectList(new CrudeDefaultRuleTypeRefServiceClient().FetchAll(),
                               "DefaultRuleTypeRcd",
                               "DefaultRuleTypeName",
                               contract.DefaultRuleTypeRcd
                               );

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

            contract.DateTime = DateTime.UtcNow;


            return(View(
                       "~/Views/Crude/Default/CrudeDefaultRule/CrudeDefaultRuleCreate.cshtml",
                       contract
                       ));
        }
Example #2
0
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid defaultRuleId, System.Guid defaultUserId)
        {
            var service = new CrudeDefaultRuleServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByDefaultRuleId(defaultRuleId);
                defaultRuleTypeRefCombo.Text   = _contract.DefaultRuleTypeRcd != null ? _contract.DefaultRuleTypeRcd : String.Empty;
                textBoxAddress.Text            = _contract.Address;
                _contract.DefaultUserId        = defaultUserId;
                dateTimePickerDateTime.Value   = _contract.DateTime != DateTime.MinValue ? _contract.DateTime : dateTimePickerDateTime.MinDate;
                dateTimePickerDateTime.Checked = _contract.DateTime != DateTime.MinValue;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
Example #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 defaultRuleTypeRcd, string address, System.Guid defaultUserId, System.DateTime dateTime)
        {
            try {
                _contract = new CrudeDefaultRuleContract();
                _isNew    = true;
                _contract.DefaultRuleTypeRcd   = defaultRuleTypeRcd;
                defaultRuleTypeRefCombo.Text   = _contract.DefaultRuleTypeRcd != null ? _contract.DefaultRuleTypeRcd : String.Empty;
                _contract.Address              = address;
                textBoxAddress.Text            = _contract.Address;
                _contract.DefaultUserId        = defaultUserId;
                _contract.DateTime             = dateTime;
                dateTimePickerDateTime.Value   = _contract.DateTime != DateTime.MinValue ? _contract.DateTime : dateTimePickerDateTime.MinDate;
                dateTimePickerDateTime.Checked = _contract.DateTime != DateTime.MinValue;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Example #4
0
        public ActionResult CrudeDefaultRuleCreate([Bind()] CrudeDefaultRuleContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeDefaultRuleServiceClient().Insert(contract);

                return(RedirectToAction("CrudeDefaultRuleIndex"));
            }

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultRule/CrudeDefaultRuleCreate.cshtml",
                       contract
                       ));
        }
Example #5
0
        public ActionResult CrudeDefaultRuleEdit([Bind()] CrudeDefaultRuleContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DefaultUserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}");

                new CrudeDefaultRuleServiceClient().Update(contract);

                return(RedirectToAction("CrudeDefaultRuleIndex"));
            }

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultRule/CrudeDefaultRuleEdit.cshtml",
                       contract
                       ));
        }
Example #6
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 CrudeDefaultRuleContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
Example #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 CrudeDefaultRuleContract();
         _isNew     = true;
         this.Text += " - Not Savable (DefaultUser Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
Example #8
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByDefaultRuleType(string defaultRuleTypeRcd)
        {
            try {
                _contract = new CrudeDefaultRuleContract();
                _isNew    = true;
                _contract.DefaultRuleTypeRcd = defaultRuleTypeRcd;
                defaultRuleTypeRefCombo.Text = _contract.DefaultRuleTypeRcd != null ? _contract.DefaultRuleTypeRcd : String.Empty;

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