Exemple #1
0
        private async Task Detail(DocumentActions document)
        {
            if (document == null)
            {
                return;
            }
            UnitOfWork unitOfWork = new UnitOfWork();

            ActionTakenGridView.ShowLoadingPanel();
            var list = await new UnitOfWork().DocumentActionsRepo.Fetch(x =>
                                                                        x.RefId == document.RefId && x.TableName == document.TableName,
                                                                        orderBy: x => x.OrderByDescending(m => m.DateCreated), includeProperties: "RoutedToUsers").ToListAsync();

            if (document.TableName == "PurchaseRequests")
            {
                var po = await unitOfWork.PurchaseOrdersRepo.GetAsync(x => x.PRId == document.RefId);

                foreach (var i in po)
                {
                    foreach (var obr in i.Obligations)
                    {
                        list.AddRange(unitOfWork.DocumentActionsRepo.Get(x =>
                                                                         x.RefId == obr.Id && x.TableName == "Obligations"));
                    }
                }
            }


            this.ActionTakenGridControl.DataSource = list;

            ActionTakenGridView.HideLoadingPanel();
        }
Exemple #2
0
        private async void Detail(DocumentActionsVM document)
        {
            if (document == null)
            {
                return;
            }

            ActionTakenGridView.ShowLoadingPanel();
            var list = await httpClient.PostAsync("api/dashboard/GetDetails", new FormUrlEncodedContent(
                                                      new Dictionary <string, string>()
            {
                { "RefId", document.RefId?.ToString() },
                { "TableName", document.TableName },
            }));

            var _list = await list.Content.ReadAsStringAsync();

            ActionTakenGridControl.DataSource = JsonConvert.DeserializeObject <List <DocumentActionsVM> >(_list);
            ActionTakenGridView.HideLoadingPanel();
        }