public void LoadSearchResult(string Suppliername) { IRefundFromSuppliersListRepository purchaseRepository = new RefundFromSuppliersListRepository(); this.ShowAllCount = purchaseRepository.GetAllPurInvoice().Count(); this.RefundFromSuppliersList = purchaseRepository.GetAllPurInvoice().Where(x => x.SupplierName == Suppliername).ToList(); }
private void RefreshData() { IRefundFromSuppliersListRepository purchaseRepository = new RefundFromSuppliersListRepository(); this.DateFormat = purchaseRepository.GetDateFormat(); this.ShowAllCount = purchaseRepository.GetAllPurInvoice().Count(); GetOptionsandTaxValues(); this.JsonData = purchaseRepository.GetLastSelectionData(); this.RefundFromSuppliersList = purchaseRepository.GetAllPurInvoiceJson(this.JsonData).ToList(); this.RefundFromSuppliersListcmb = purchaseRepository.GetAllPurInvoice().OrderBy(e => e.SupplierName).ToList(); this.ShowSelectedCount = this.RefundFromSuppliersList.Count(); this.RefundFromSuppliersListcmbDebit = this.RefundFromSuppliersListcmb.GroupBy(x => x.CashChequeNo).Select(g => g.First()).Where(y => y.CashChequeNo != null).OrderBy(e => e.CashChequeNo).ToList(); this.RefundFromSuppliersListcmbSup = this.RefundFromSuppliersList.GroupBy(x => x.SupplierName).Select(y => y.First()).Distinct().OrderBy(e => e.SupplierName).ToList(); this.RefundFromSuppliersListcmbInv = this.RefundFromSuppliersList.GroupBy(x => x.InvoiceNo).Select(y => y.First()).Distinct().OrderBy(e => e.InvoiceNo).ToList(); this.YearRange = purchaseRepository.GetYearRange().ToList(); //changedateformat(this.RefundFromSuppliersList); //changedateformat(this.RefundFromSuppliersListcmb); changeNumberformat(this.RefundFromSuppliersList); changeNumberformat(this.RefundFromSuppliersListcmb); DefaultList = this.RefundFromSuppliersList; FullPQList = this.RefundFromSuppliersListcmb; //this.ShowAllCount = this.PurchaseInvoiceListcmb.Count(); SetDefaultSearchSelection(); var Updateddate = this.RefundFromSuppliersListcmb.Max(x => x.CreatedDate); string date = this.DateFormat as string; this.LastUpdateDate = Convert.ToDateTime(Updateddate).ToString(date); TotalCashChequeAmount = Convert.ToString(RefundFromSuppliersList.Sum(e => e.CashChequeAmount)); TotalPOPIAmount = Convert.ToString(RefundFromSuppliersList.Sum(e => e.InvoiceAmountValue)); //this.GetData(this.SelectedSearchSupplier); }