}//end void showincGST(object param) { Mouse.OverrideCursor = Cursors.Wait; int decimalpoints = Convert.ToInt32(this.DecimalPlaces); //foreach (var item in this.CustomerCreditPaidDays) //{ // //item.InvoiceAmount = item.InvoiceAmountIncGST; // item.InvoiceAmount = Math.Round(Convert.ToDouble(item.InvoiceAmountIncGST), decimalpoints).ToString(); //} //if (this.ShowAllTrue == false) // this.CustomerCreditPaidDays = DefaultList.Where(x => x.ExcIncGST == true).ToList(); //else // this.CustomerCreditPaidDays = FullPQList.Where(x => x.ExcIncGST == true).ToList(); ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository(); this.CustomerCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList(); if (this.ShowAllTrue == false) { this.ShowSelectedCount = this.CustomerCreditPaidDays.Count(); } else { this.ShowSelectedCount = 0; } this.CustomerCreditPaidDayscmb = this.CustomerCreditPaidDays.OrderBy(x => x.CustomerName).ToList(); this.CustomerCreditPaidDayscmbCredit = this.CustomerCreditPaidDayscmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).OrderBy(x => x.CreditCashNO).Where(y => y.CashCreditNo != null).ToList(); this.CustomerCreditPaidDayscmbSup = this.CustomerCreditPaidDays.GroupBy(x => x.CustomerName).Select(y => y.First()).OrderBy(x => x.CustomerName).Distinct().ToList(); this.CustomerCreditPaidDayscmbInv = this.CustomerCreditPaidDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.SortInvoiceNo).Distinct().ToList(); DefaultList = this.CustomerCreditPaidDayscmb; Mouse.OverrideCursor = null; }
private void RefreshData() { ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository(); // this.DateFormat = purchaseRepository.GetDateFormat(); //this.ShowAllCount = purchaseRepository.GetAllPurchaseInvoice().Count(); GetOptionsandTaxValues(); this.JsonData = purchaseRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.CustomerCreditPaidDays)); this.CustomerCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList(); this.CustomerCreditPaidDayscmb = this.CustomerCreditPaidDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList(); this.ShowSelectedCount = this.CustomerCreditPaidDays.Count(); this.YearRange = purchaseRepository.GetYearRange().ToList(); this.AveragePaidDays = this.CustomerCreditPaidDays.Average(e => e.PaidInDays).ToString(); DefaultList = this.CustomerCreditPaidDays; FullPQList = this.CustomerCreditPaidDays; //this.ShowAllCount = this.CustomerCreditPaidDayscmb.Count(); SetDefaultSearchSelection(); // this.TotalCusM1 = Convert.ToString(CustomerCreditPaidDays.Sum(e => e.TotalM1)); }
void showexcGST(object param) { Mouse.OverrideCursor = Cursors.Wait; int decimalpoints = Convert.ToInt32(this.DecimalPlaces); ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository(); this.CustomerCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList(); if (this.ShowAllTrue == false) { this.ShowSelectedCount = this.CustomerCreditPaidDays.Count(); } else { this.ShowSelectedCount = 0; } this.CustomerCreditPaidDayscmb = this.CustomerCreditPaidDays.OrderBy(x => x.CustomerName).ToList(); this.CustomerCreditPaidDayscmbCredit = this.CustomerCreditPaidDayscmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).OrderBy(x => x.CreditCashNO).Where(y => y.CashCreditNo != null).ToList(); this.CustomerCreditPaidDayscmbSup = this.CustomerCreditPaidDays.GroupBy(x => x.CustomerName).Select(y => y.First()).OrderBy(x => x.CustomerName).Distinct().ToList(); this.CustomerCreditPaidDayscmbInv = this.CustomerCreditPaidDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.SortInvoiceNo).Distinct().ToList(); DefaultList = this.CustomerCreditPaidDayscmb; Mouse.OverrideCursor = null; }
void Search(object param) { if (Count != 0) { SearchValues = new List <SearchEntity>(); //this.ShowSelectedTrue = true; //this.ShowAllTrue = false; if (this.SelectedSearchYear != null || this.SelectedSearchYear == string.Empty) { SearchEntity value = new SearchEntity(); value.FieldName = "Year"; value.FieldValue = this.SelectedSearchYear; SearchValues.Add(value); var year = Convert.ToInt32(this.SelectedSearchYear); } else { SearchEntity value = new SearchEntity(); value.FieldName = "Year"; value.FieldValue = "0"; SearchValues.Add(value); var year = Convert.ToInt32(this.SelectedSearchYear); } if (this.SelectedSearchQuarter != null || this.SelectedSearchQuarter == string.Empty) { SearchEntity value = new SearchEntity(); value.FieldName = "Quarter"; value.FieldValue = this.SelectedSearchQuarter; int month1; int month2; int month3; if (Convert.ToInt32(this.SelectedSearchQuarter) == 1) { month1 = 1; month2 = 2; month3 = 3; } else if (Convert.ToInt32(this.SelectedSearchQuarter) == 2) { month1 = 4; month2 = 5; month3 = 6; } else if (Convert.ToInt32(this.SelectedSearchQuarter) == 3) { month1 = 7; month2 = 8; month3 = 9; } else { month1 = 10; month2 = 11; month3 = 12; } SearchValues.Add(value); } else { SearchEntity value = new SearchEntity(); value.FieldName = "Quarter"; value.FieldValue = "0"; SearchValues.Add(value); } if (this.SelectedSearchMonth != null || this.SelectedSearchMonth == string.Empty) { SearchEntity value = new SearchEntity(); value.FieldName = "Month"; value.FieldValue = this.SelectedSearchMonth; SearchValues.Add(value); var month = Convert.ToInt32(this.SelectedSearchMonth); } else { SearchEntity value = new SearchEntity(); value.FieldName = "Month"; value.FieldValue = "0"; SearchValues.Add(value); } jsonSearch = JsonConvert.SerializeObject(SearchValues); this.JsonData = jsonSearch; ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository(); var results = purchaseRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.CustomerCreditPaidDays), "CustomerCreditPaidDays_List"); if (Count != 0) { this.CustomerCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(jsonSearch).ToList(); this.CustomerCreditPaidDayscmb = this.CustomerCreditPaidDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList(); this.AveragePaidDays = this.CustomerCreditPaidDays.Average(e => e.PaidInDays).ToString(); } DefaultList = this.CustomerCreditPaidDayscmb; //this.TotalCusM1 = Convert.ToString(CustomerCreditPaidDays.Sum(e => e.TotalM1)); } }