public void LoadSearchResult(string Suppliername) { IPaymentFromCustomersListRepository purchaseRepository = new PaymentFromCustomersListRepository(); this.ShowAllCount = purchaseRepository.GetAllPurInvoice().Count(); this.PaymentsFromCustomersList = purchaseRepository.GetAllPurInvoice().Where(x => x.CustomerName == Suppliername).OrderBy(x => x.CustomerName).ToList(); }
private void RefreshData() { IPaymentFromCustomersListRepository purchaseRepository = new PaymentFromCustomersListRepository(); this.DateFormat = purchaseRepository.GetDateFormat(); this.ShowAllCount = purchaseRepository.GetAllPurInvoice().Count(); GetOptionsandTaxValues(); this.JsonData = purchaseRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.PaymentFromCustomersList)); this.PaymentsFromCustomersList = purchaseRepository.GetAllPurInvoiceJson(this.JsonData).OrderBy(x => x.CustomerName).ToList(); this.PaymentsFromCustomersListcmb = purchaseRepository.GetAllPurInvoice().OrderBy(x => x.CustomerName).ToList(); this.ShowSelectedCount = this.PaymentsFromCustomersList.Count(); this.PaymentsFromCustomersListcmbDebit = this.PaymentsFromCustomersListcmb.GroupBy(x => x.CashChequeNo).Select(g => g.First()).Where(y => y.CashChequeNo != null).OrderBy(x => x.CashChequeNo).ToList(); this.PaymentsFromCustomersListcmbSup = this.PaymentsFromCustomersList.GroupBy(x => x.CustomerName).Select(y => y.First()).Distinct().OrderBy(x => x.CustomerName).ToList(); this.PaymentsFromCustomersListcmbInv = this.PaymentsFromCustomersList.GroupBy(x => x.InvoiceNo).Select(y => y.First()).Distinct().OrderBy(x => x.InvoiceNo).ToList(); this.YearRange = purchaseRepository.GetYearRange().ToList(); changedateformat(this.PaymentsFromCustomersList); changedateformat(this.PaymentsFromCustomersListcmb); changeNumberformat(this.PaymentsFromCustomersList); changeNumberformat(this.PaymentsFromCustomersListcmb); DefaultList = this.PaymentsFromCustomersList; FullPQList = this.PaymentsFromCustomersListcmb; //this.ShowAllCount = this.PurchaseInvoiceListcmb.Count(); SetDefaultSearchSelection(this.JsonData); var Updateddate = this.PaymentsFromCustomersListcmb.Max(x => x.CreatedDate); string date = this.DateFormat as string; this.LastUpdateDate = Convert.ToDateTime(Updateddate).ToString(date); TotalCashChequeAmount = Convert.ToString(PaymentsFromCustomersList.Sum(e => e.CashChequeAmount)); TotalPOPIAmount = Convert.ToString(PaymentsFromCustomersList.Sum(e => e.InvoiceAmountValue)); //this.GetData(this.SelectedSearchSupplier); }