// shows the form in edit modus
        // links:
        //  docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77
        public void ShowAsEdit(System.Guid clientContactMethodId)
        {
            var service = new CrudeClientContactMethodServiceClient();

            _isNew = false;
            try {
                _contract = service.FetchByClientContactMethodId(clientContactMethodId);
                clientContactMethodRefCombo.Text = _contract.ClientContactMethodRcd != null ? _contract.ClientContactMethodRcd : String.Empty;
                textBoxContactMethodWay.Text     = _contract.ContactMethodWay;
                textBoxComment.Text         = _contract.Comment;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                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(System.Guid clientId, string clientContactMethodRcd, string contactMethodWay, string comment, System.Guid userId)
        {
            try {
                _contract          = new CrudeClientContactMethodContract();
                _isNew             = true;
                _contract.ClientId = clientId;
                _contract.ClientContactMethodRcd = clientContactMethodRcd;
                clientContactMethodRefCombo.Text = _contract.ClientContactMethodRcd != null ? _contract.ClientContactMethodRcd : String.Empty;
                _contract.ContactMethodWay       = contactMethodWay;
                textBoxContactMethodWay.Text     = _contract.ContactMethodWay;
                _contract.Comment           = comment;
                textBoxComment.Text         = _contract.Comment;
                _contract.UserId            = userId;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                if (ex == null)
                {
                }
                else
                {
                    System.Diagnostics.Debugger.Break();
                }
            }
        }
示例#3
0
        public ActionResult ClientContactMethodCreate(System.Guid?clientId, System.Guid?userId)
        {
            var contract = new CrudeClientContactMethodContract();

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

            ViewBag.ClientContactMethodRcd =
                new SelectList(new CrudeClientContactMethodRefServiceClient().FetchAll(),
                               "ClientContactMethodRcd",
                               "ClientContactMethodName",
                               contract.ClientContactMethodRcd
                               );

            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", "ClientContactMethod", "ClientContactMethodCreate"),
                       contract
                       ));
        }
        public ActionResult CrudeClientContactMethodCreate([Bind()] CrudeClientContactMethodContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeClientContactMethodServiceClient().Insert(contract);

                return(RedirectToAction("CrudeClientContactMethodIndex"));
            }

            return(View(
                       "~/Views/Crude/Client/CrudeClientContactMethod/CrudeClientContactMethodCreate.cshtml",
                       contract
                       ));
        }
示例#5
0
        public ActionResult ClientContactMethodEdit([Bind()] CrudeClientContactMethodContract contract)
        {
            if (ModelState.IsValid)
            {
                new CrudeClientContactMethodServiceClient().Update(contract);

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

            return(View(
                       MVCHelper.Resolve(Request, "Client", "ClientContactMethod", "ClientContactMethodEdit"),
                       contract
                       ));
        }
示例#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 CrudeClientContactMethodContract();
         _isNew    = true;
         Show();
     } catch (Exception ex) {
         if (ex == null)
         {
         }
         else
         {
             System.Diagnostics.Debugger.Break();
         }
     }
 }
        public ActionResult CrudeClientContactMethodEdit([Bind()] CrudeClientContactMethodContract contract)
        {
            if (ModelState.IsValid)
            {
                contract.DateTime = DateTime.UtcNow;

                new CrudeClientContactMethodServiceClient().Update(contract);

                return(RedirectToAction("CrudeClientContactMethodIndex"));
            }

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

            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.ClientContactMethodRcd =
                new SelectList(new CrudeClientContactMethodRefServiceClient().FetchAll(),
                               "ClientContactMethodRcd",
                               "ClientContactMethodName",
                               contract.ClientContactMethodRcd
                               );

            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/CrudeClientContactMethod/CrudeClientContactMethodCreate.cshtml",
                       contract
                       ));
        }
        // 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 CrudeClientContactMethodContract();
                _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();
                }
            }
        }
示例#11
0
        // shows by foreign keys
        // links:
        //  docLink: http://sql2x.org/documentationLink/f21e72c1-2d57-44c1-a9c1-1b80bad6a391
        public void ShowAsAddByContactMethod(string contactMethodRcd)
        {
            try {
                _contract                   = new CrudeClientContactMethodContract();
                _isNew                      = true;
                _contract.DateTime          = DateTime.UtcNow;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();
                _contract.ContactMethodRcd  = contactMethodRcd;
                contactMethodRefCombo.Text  = _contract.ContactMethodRcd != null ? _contract.ContactMethodRcd : String.Empty;

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