Esempio 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 clientLinkId)
        {
            var service = new CrudeClientLinkServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByClientLinkId(clientLinkId);
                clientLinkTypeRefCombo.Text = _contract.ClientLinkTypeRcd != null ? _contract.ClientLinkTypeRcd : String.Empty;
                textBoxLinkName.Text        = _contract.LinkName;
                textBoxLink.Text            = _contract.Link;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            } finally {
                service.Close();
            }
        }
Esempio n. 2
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(System.Guid clientId, string clientLinkTypeRcd, string linkName, string link, System.Guid userId)
        {
            try {
                _contract                   = new CrudeClientLinkContract();
                _isNew                      = true;
                _contract.ClientId          = clientId;
                _contract.ClientLinkTypeRcd = clientLinkTypeRcd;
                clientLinkTypeRefCombo.Text = _contract.ClientLinkTypeRcd != null ? _contract.ClientLinkTypeRcd : String.Empty;
                _contract.LinkName          = linkName;
                textBoxLinkName.Text        = _contract.LinkName;
                _contract.Link              = link;
                textBoxLink.Text            = _contract.Link;
                _contract.UserId            = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Esempio n. 3
0
        public ActionResult ClientLinkCreate(System.Guid?clientId, System.Guid?userId)
        {
            var contract = new CrudeClientLinkContract();

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

            ViewBag.ClientLinkTypeRcd =
                new SelectList(new CrudeClientLinkTypeRefServiceClient().FetchAll(),
                               "ClientLinkTypeRcd",
                               "ClientLinkTypeName",
                               contract.ClientLinkTypeRcd
                               );

            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(
                       MVCHelper.Resolve(Request, "Client", "ClientLink", "ClientLinkCreate"),
                       contract
                       ));
        }
        public ActionResult CrudeClientLinkCreate([Bind()] CrudeClientLinkContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeClientLinkServiceClient().Insert(contract);

                return(RedirectToAction("CrudeClientLinkIndex"));
            }

            return(View(
                       "~/Views/Crude/Client/CrudeClientLink/CrudeClientLinkCreate.cshtml",
                       contract
                       ));
        }
Esempio n. 5
0
        public ActionResult ClientLinkEdit([Bind()] CrudeClientLinkContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeClientLinkServiceClient().Update(contract);

                return(RedirectToAction("ClientLinkByClientIndex", new { clientId = contract.ClientId }));
            }

            return(View(
                       MVCHelper.Resolve(Request, "Client", "ClientLink", "ClientLinkEdit"),
                       contract
                       ));
        }
        public ActionResult CrudeClientLinkEdit([Bind()] CrudeClientLinkContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeClientLinkServiceClient().Update(contract);

                return(RedirectToAction("CrudeClientLinkIndex"));
            }

            return(View(
                       "~/Views/Crude/Client/CrudeClientLink/CrudeClientLinkEdit.cshtml",
                       contract
                       ));
        }
Esempio n. 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 CrudeClientLinkContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
Esempio n. 8
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 CrudeClientLinkContract();
         _isNew     = true;
         this.Text += " - Not Savable (Client,User Missing)";
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeClientLinkCreate(System.Guid?clientId, System.Guid?userId)
        {
            var contract = new CrudeClientLinkContract();

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

            ViewBag.ClientId =
                new SelectList(new CrudeClientServiceClient().FetchAll(),
                               "ClientId",
                               "FirstName",
                               contract.ClientId
                               );

            ViewBag.LinkTypeRcd =
                new SelectList(new CrudeLinkTypeRefServiceClient().FetchAll(),
                               "LinkTypeRcd",
                               "LinkTypeName",
                               contract.LinkTypeRcd
                               );

            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/Client/CrudeClientLink/CrudeClientLinkCreate.cshtml",
                       contract
                       ));
        }
Esempio n. 10
0
        // shows the form with default values for comboboxes and pickers
        // links:
        //  docLink: http://sql2x.org/documentationLink/599dcb45-f71b-4672-bb18-46975a4fe9b3
        public void ShowAsAddByRules(System.Guid userId)
        {
            try {
                _contract                   = new CrudeClientLinkContract();
                _isNew                      = true;
                _contract.UserId            = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Esempio n. 11
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 CrudeClientLinkContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ClientId          = clientId;
                clientPicker.SelectedValue  = _contract.ClientId;

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
Esempio n. 12
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByLinkTypeAndLink(string linkTypeRcd, string link)
        {
            try {
                _contract                   = new CrudeClientLinkContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.LinkTypeRcd       = linkTypeRcd;
                linkTypeRefCombo.Text       = _contract.LinkTypeRcd != null ? _contract.LinkTypeRcd : String.Empty;
                _contract.Link              = link;
                textBoxLink.Text            = _contract.Link;

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