Ejemplo n.º 1
0
        private async void DoLoadWorkflow(object obj)
        {
            Responses = new ObservableCollection <QueryResponseVM>();
            if (FormQuery != null && FormQuery.Id > 0)
            {
                try
                {
                    var result = await RestHub.QueryWorkflow(FormQuery.Id);

                    if (result.UserObject != null)
                    {
                        QueryWorkflowDTO dto = result.UserObject as QueryWorkflowDTO;
                        if (dto != null)
                        {
                            AllowSubmit = dto.AllowSubmit;
                            AllowReject = dto.AllowReject;
                            string before = String.IsNullOrEmpty(dto.PreviousUser) ? String.Empty : dto.PreviousUser + " <img src='http://www.iconsdb.com/icons/download/icon-sets/web-2-blue/arrow-11-24.jpg'/>";
                            string after  = String.IsNullOrEmpty(dto.NextUser) ? String.Empty : "<img src='http://www.iconsdb.com/icons/download/orange/arrow-11-24.jpg'/>" + dto.NextUser;
                            QueryWorkflow = $"{before} <b>{dto.CurrentUser}</b> {after}";
                        }
                    }
                    else
                    {
                        MessageBox.Show("Can't Load Responses . .");
                    }
                }
                catch (Exception ex)
                {
                    AppErrorBox.ShowErrorMessage("Error while Loading Responses . .", ex.ToString());
                }
            }
        }