Beispiel #1
0
        private void RefreshData()
        {
            IPurchaseOrderListRepository purchaseRepository = new PurchaseOrderListRepository();

            this.DateFormat   = purchaseRepository.GetDateFormat();
            this.ShowAllCount = purchaseRepository.GetAllPurOrder().Count();
            GetOptionsandTaxValues();
            this.JsonData             = purchaseRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.PurchaseOrderList));
            this.PurchaseOrderList    = purchaseRepository.GetAllPurOrderJson(this.JsonData, this.IncludingGSTTrue).OrderBy(e => e.SupplierName).ToList();
            this.ShowSelectedCount    = this.PurchaseOrderList.Count();
            this.PurchaseOrderListcmb = purchaseRepository.GetAllPurOrder().OrderBy(e => e.SupplierName).ToList();
            this.YearRange            = purchaseRepository.GetYearRange().ToList();
            //changedateformat(this.PurchaseOrderList);
            changeNumberformat(this.PurchaseOrderList);
            changeNumberformat(this.PurchaseOrderListcmb);
            DefaultList = this.PurchaseOrderListcmb;
            FullPQList  = this.PurchaseOrderListcmb;

            this.PurchaseOrderListcmbSup = this.PurchaseOrderList.GroupBy(x => x.SupplierName).Select(y => y.First()).OrderBy(x => x.SupplierName).Distinct().ToList();
            this.PurchaseOrderListcmbONo = this.PurchaseOrderList.GroupBy(x => x.OrderNo).Select(y => y.First()).OrderBy(x => x.SortOrderNo).Distinct().ToList();
            //this.ShowAllCount = this.PurchaseOrderListcmb.Count();
            SetDefaultSearchSelection(this.JsonData);
            var    Updateddate = this.PurchaseOrderListcmb.Max(x => x.CreatedDateList);
            string date        = this.DateFormat as string;

            this.LastUpdateDate = Convert.ToDateTime(Updateddate).ToString(date);

            TotalAmount  = Convert.ToString(PurchaseOrderList.Sum(e => e.OAmount));
            DepositTotal = Convert.ToString(PurchaseOrderList.Sum(e => e.DAmount));

            //this.GetData(this.SelectedSearchSupplier);
        }