void HandleAddButton(object sender, EventArgs e)
        {
            try {
                var addC = new QueryController(Service, new UserQuery());
                var navC = new UINavigationController(addC);

                addC.Done += delegate {
                    var q = new UserQuery {
                        Filter    = addC.Filter,
                        FeedId    = addC.Feed.Id,
                        Name      = addC.Name,
                        OrderBy   = addC.OrderBy,
                        ServiceId = Service.Id
                    };

                    using (var repo = new Repo()) {
                        repo.Add(q);
                    }

                    addC.DismissModalViewControllerAnimated(true);
                };

                NavigationController.PresentModalViewController(navC, true);
            } catch (Exception error) {
                Log.Error(error);
            }
        }
Esempio n. 2
0
        void HandleDoneButton(object sender, EventArgs e)
        {
            try {
                var service = new UserService {
                    Name           = _nameElement.Value.Trim(),
                    ServiceRootUri = _urlElement.Value.Trim()
                };

                if (service.Name.Length > 0 && service.ServiceRootUri.Length > 0)
                {
                    using (var repo = new Repo()) {
                        repo.Add(service);
                    }

                    DismissModalViewControllerAnimated(true);

                    _doneAction();
                }
                else
                {
                    _noAlert = new UIAlertView("", "Please completely fill in the form to add the service.", null, "OK");
                    _noAlert.Show();
                }
            } catch (Exception error) {
                Log.Error(error);
            }
        }
Esempio n. 3
0
        void HandleDoneButton(object sender, EventArgs e)
        {
            try {

                var service = new UserService {
                    Name = _nameElement.Value.Trim (),
                    ServiceRootUri = _urlElement.Value.Trim ()
                };

                if (service.Name.Length > 0 && service.ServiceRootUri.Length > 0) {

                    using (var repo = new Repo ()) {
                        repo.Add (service);
                    }

                    DismissModalViewControllerAnimated (true);

                    _doneAction ();

                } else {

                    _noAlert = new UIAlertView ("", "Please completely fill in the form to add the service.", null, "OK");
                    _noAlert.Show ();

                }

            } catch (Exception error) {
                Log.Error (error);
            }
        }
Esempio n. 4
0
        void HandleAddButton(object sender, EventArgs e)
        {
            try {

                var addC = new QueryController (Service, new UserQuery());
                var navC = new UINavigationController (addC);

                addC.Done += delegate {

                    var q = new UserQuery {
                        Filter = addC.Filter,
                        FeedId = addC.Feed.Id,
                        Name = addC.Name,
                        OrderBy = addC.OrderBy,
                        ServiceId = Service.Id
                    };

                    using (var repo = new Repo ()) {
                        repo.Add (q);
                    }

                    addC.DismissModalViewControllerAnimated (true);
                };

                NavigationController.PresentModalViewController (navC, true);

            } catch (Exception error) {
                Log.Error (error);
            }
        }