public void LoadSearchResult(string Customername) { ICreditNoteListRepository SalesRepository = new CreditNoteListRepository(); this.ShowAllCount = SalesRepository.GetAllSalesCredit().Count(); this.CreditNoteList = SalesRepository.GetAllSalesCredit().Where(x => x.CustomerName == Customername).OrderBy(x => x.CustomerName).ToList(); }
private void RefreshData() { ICreditNoteListRepository SalesRepository = new CreditNoteListRepository(); // this.DateFormat = SalesRepository.GetDateFormat(); this.ShowAllCount = SalesRepository.GetAllSalesCredit().Count(); GetOptionsandTaxValues(); this.JsonData = SalesRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.CreditNoteList)); this.CreditNoteList = SalesRepository.GetAllSalesCreditJson(this.JsonData, this.IncludingGSTTrue).OrderBy(x => x.CustomerName).ToList(); this.CreditNoteListcmb = SalesRepository.GetAllSalesCredit().OrderBy(x => x.CustomerName).ToList(); this.ShowSelectedCount = this.CreditNoteList.Count(); this.CreditNoteListcmbCredit = this.CreditNoteListcmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).Where(y => y.CashCreditNo != null).OrderBy(x => x.CreditCashNO).ToList(); this.CreditNoteListcmbCus = this.CreditNoteList.GroupBy(x => x.CustomerName).Select(y => y.First()).Distinct().OrderBy(x => x.CustomerName).ToList(); this.CreditNoteListcmbCus = this.CreditNoteList.GroupBy(x => x.CustomerName).Select(y => y.First()).Distinct().OrderBy(x => x.CustomerName).ToList(); this.CreditNoteListcmbInv = this.CreditNoteList.GroupBy(x => x.CreditNo).Select(y => y.First()).Distinct().OrderBy(x => x.SortCreditNoteNo).ToList(); this.YearRange = SalesRepository.GetYearRange().ToList(); changeNumberformat(this.CreditNoteList); changeNumberformat(this.CreditNoteListcmb); DefaultList = this.CreditNoteList; FullPQList = this.CreditNoteListcmb; //this.ShowAllCount = this.CreditNoteListcmb.Count(); SetDefaultSearchSelection(this.JsonData); var Updateddate = this.CreditNoteListcmb.Max(x => x.CreatedDate); string date = this.DateFormat as string; this.LastUpdateDate = Convert.ToDateTime(Updateddate).ToString(date); this.CreditAmount = Convert.ToString(CreditNoteList.Sum(e => e.CreditAmountValue)); //this.GetData(this.SelectedSearchCustomer); }