// 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 defaultSystemReferenceTableName, string defaultSystemReferenceDisplayName, System.Guid defaultUserId, System.DateTime dateTime)
        {
            try {
                _contract = new CrudeDefaultSystemReferenceTableContract();
                _isNew    = true;
                _contract.DefaultSystemReferenceTableName     = defaultSystemReferenceTableName;
                textBoxDefaultSystemReferenceTableName.Text   = _contract.DefaultSystemReferenceTableName;
                _contract.DefaultSystemReferenceDisplayName   = defaultSystemReferenceDisplayName;
                textBoxDefaultSystemReferenceDisplayName.Text = _contract.DefaultSystemReferenceDisplayName;
                _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();
                }
            }
        }
        // shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid defaultSystemReferenceTableId, System.Guid defaultUserId)
        {
            var service = new CrudeDefaultSystemReferenceTableServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByDefaultSystemReferenceTableId(defaultSystemReferenceTableId);
                textBoxDefaultSystemReferenceTableName.Text   = _contract.DefaultSystemReferenceTableName;
                textBoxDefaultSystemReferenceDisplayName.Text = _contract.DefaultSystemReferenceDisplayName;
                _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();
            }
        }
Esempio n. 3
0
        public ActionResult CrudeDefaultSystemReferenceTableCreate([Bind()] CrudeDefaultSystemReferenceTableContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeDefaultSystemReferenceTableServiceClient().Insert(contract);

                return(RedirectToAction("CrudeDefaultSystemReferenceTableIndex"));
            }

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultSystemReferenceTable/CrudeDefaultSystemReferenceTableCreate.cshtml",
                       contract
                       ));
        }
Esempio n. 4
0
        public ActionResult CrudeDefaultSystemReferenceTableEdit([Bind()] CrudeDefaultSystemReferenceTableContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DefaultUserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}");

                new CrudeDefaultSystemReferenceTableServiceClient().Update(contract);

                return(RedirectToAction("CrudeDefaultSystemReferenceTableIndex"));
            }

            return(View(
                       "~/Views/Crude/Default/CrudeDefaultSystemReferenceTable/CrudeDefaultSystemReferenceTableEdit.cshtml",
                       contract
                       ));
        }
Esempio n. 5
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 CrudeDefaultSystemReferenceTableContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
Esempio n. 6
0
        public ActionResult CrudeDefaultSystemReferenceTableCreate(System.Guid?defaultUserId)
        {
            var contract = new CrudeDefaultSystemReferenceTableContract();

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

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

            contract.DateTime = DateTime.UtcNow;


            return(View(
                       "~/Views/Crude/Default/CrudeDefaultSystemReferenceTable/CrudeDefaultSystemReferenceTableCreate.cshtml",
                       contract
                       ));
        }