Ejemplo n.º 1
0
        private void UpdateIssue(Issue obj)
        {
            var found = JobItems.FirstOrDefault(p => p.IssueId == obj.IssueId);

            found.IsResolved   = true;
            found.JobPerformed = obj.JobPerformed;
        }
Ejemplo n.º 2
0
 private void UpdateIssie()
 {
     TechnicianModule.hubProxy.On <Issue>("updateIssue", issue =>
     {
         var updateItem = JobItems.FirstOrDefault(p => p.IssueId == issue.IssueId);
         if (updateItem != null)
         {
             updateItem.IsResolved   = true;
             updateItem.Status       = "Resolved";
             updateItem.JobPerformed = issue.JobPerformed;
         }
     });
 }
Ejemplo n.º 3
0
        public AdminJobcardItemsViewModel(INavigationService navigationService)
        {
            FlurlClient         = new FlurlClient(ServerPath.Path);
            _navigatiponService = navigationService;
            MenuCommand         = new DelegateCommand <Issue>(menu);
            DeleteCommand       = new DelegateCommand(DeleteIssue);

            AdminModule.hubProxy.On <Issue>("updateIssue", text =>
            {
                var _issue = JobItems.FirstOrDefault(p => p.IssueId == text.IssueId);
                if (_issue != null)
                {
                    _issue.IsResolved = true;
                    _issue.Status     = "Solved";
                }
            });
        }
Ejemplo n.º 4
0
        private async void GetOptions(Issue issue)
        {
            var action = await Acr.UserDialogs.UserDialogs.Instance.ActionSheetAsync("Issue", "Cancel", "", null, "Details", "Remove");

            switch (action)
            {
            case "Details":
            {
                NavigationParameters para = new NavigationParameters();
                para.Add("issue", SelectedIssue);
                await _navigatiponService.NavigateAsync("AdminMasterPage/NavigationPage/AdminIssueDetailPage", para, useModalNavigation : true);

                SelectedIssue = null;
            }
            break;

            case "Remove":
            {
                var confirm = await Acr.UserDialogs.UserDialogs.Instance.ConfirmAsync("Remove issue", "", "Remove", "Cancel", null);

                if (confirm)
                {
                    Acr.UserDialogs.UserDialogs.Instance.ShowLoading("Deleting");
                    var deleted = await ServerPath.Path
                                  .AppendPathSegment("/api/jobitems/deletejobitem/" + SelectedIssue.IssueId + "/" + AdminModule.TenantName).DeleteAsync();

                    if (deleted.StatusCode == System.Net.HttpStatusCode.OK)
                    {
                        Acr.UserDialogs.UserDialogs.Instance.HideLoading();
                        var item = JobItems.FirstOrDefault(p => p.IssueId == SelectedIssue.IssueId);
                        int i    = JobItems.IndexOf(item);
                        JobItems.RemoveAt(i);
                        SelectedIssue = null;
                    }
                }
            }
            break;
            }
            SelectedIssue = null;
        }