Beispiel #1
0
        public ActionResult CrudeDefaultSystemSettingCreate(System.Guid?defaultUserId)
        {
            var contract = new CrudeDefaultSystemSettingContract();

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

            ViewBag.DefaultSystemSettingRcd =
                new SelectList(new CrudeDefaultSystemSettingRefServiceClient().FetchAll(),
                               "DefaultSystemSettingRcd",
                               "DefaultSystemSettingName",
                               contract.DefaultSystemSettingRcd
                               );

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

            contract.DateTime = DateTime.UtcNow;


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

            _isNew = false;
            try {
                _contract = service.FetchByDefaultSystemSettingId(defaultSystemSettingId);
                defaultSystemSettingRefCombo.Text     = _contract.DefaultSystemSettingRcd != null ? _contract.DefaultSystemSettingRcd : String.Empty;
                textBoxDefaultSystemSettingValue.Text = _contract.DefaultSystemSettingValue;
                _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();
            }
        }
        // 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 defaultSystemSettingRcd, string defaultSystemSettingValue, System.Guid defaultUserId, System.DateTime dateTime)
        {
            try {
                _contract = new CrudeDefaultSystemSettingContract();
                _isNew    = true;
                _contract.DefaultSystemSettingRcd     = defaultSystemSettingRcd;
                defaultSystemSettingRefCombo.Text     = _contract.DefaultSystemSettingRcd != null ? _contract.DefaultSystemSettingRcd : String.Empty;
                _contract.DefaultSystemSettingValue   = defaultSystemSettingValue;
                textBoxDefaultSystemSettingValue.Text = _contract.DefaultSystemSettingValue;
                _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();
                }
            }
        }
Beispiel #4
0
        public ActionResult CrudeDefaultSystemSettingCreate([Bind()] CrudeDefaultSystemSettingContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeDefaultSystemSettingServiceClient().Insert(contract);

                return(RedirectToAction("CrudeDefaultSystemSettingIndex"));
            }

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultSystemSetting/CrudeDefaultSystemSettingCreate.cshtml",
                       contract
                       ));
        }
Beispiel #5
0
        public ActionResult CrudeDefaultSystemSettingEdit([Bind()] CrudeDefaultSystemSettingContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DefaultUserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}");

                new CrudeDefaultSystemSettingServiceClient().Update(contract);

                return(RedirectToAction("CrudeDefaultSystemSettingIndex"));
            }

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultSystemSetting/CrudeDefaultSystemSettingEdit.cshtml",
                       contract
                       ));
        }
 // 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 CrudeDefaultSystemSettingContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
 // 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 CrudeDefaultSystemSettingContract();
         _isNew     = true;
         this.Text += " - Not Savable (DefaultUser Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByDefaultSystemSetting(string defaultSystemSettingRcd)
        {
            try {
                _contract = new CrudeDefaultSystemSettingContract();
                _isNew    = true;
                _contract.DefaultSystemSettingRcd = defaultSystemSettingRcd;
                defaultSystemSettingRefCombo.Text = _contract.DefaultSystemSettingRcd != null ? _contract.DefaultSystemSettingRcd : String.Empty;

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