private void RefreshData() { IInvoiceDebitPaymentsRepository invRepository = new InvoiceDebitPaymentsRepository(); GetOptionsandTaxValues(); this.JsonData = invRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.InvoiceDebitPaymentsList)); LstSuppliers = invRepository.GetSuppliersList(JsonData); //this.ShowAllCount = this.SupplierHistorycmb.Count(); SetDefaultSearchSelection(); }
public InvoiceDebitPaymentsEntity PrintPurchaseInvoiceDebitPayment() { // Mouse.OverrideCursor = Cursors.Wait; var siRepository = new InvoiceDebitPaymentsRepository(); var siNo = SharedValues.Print_Id; var pdbt = new InvoiceDebitPaymentsRepository(); this.JsonData = pdbt.GetLastSelectionData(Convert.ToInt32(ScreenId.InvoiceDebitPaymentsList)); int SupplierID = Convert.ToInt32(SharedValues.Print_Id); var sif = siRepository.GetPrintPurchaseInvoiceDebitPayment(SupplierID, JsonData); // var qf = sqRepository.GetSalesQuotation(sqNo); //// DataTable dt = new DataTable(); // DataTable dt = LINQResultToDataTable(qf); // dt = (DataTable)sqf; return(sif); }
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); } else { SearchEntity value = new SearchEntity(); value.FieldName = "Month"; value.FieldValue = "0"; SearchValues.Add(value); } jsonSearch = JsonConvert.SerializeObject(SearchValues); this.JsonData = jsonSearch; SharedValues.JsonDataValues = JsonData; IInvoiceDebitPaymentsRepository invRepository = new InvoiceDebitPaymentsRepository(); var results = invRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.InvoiceDebitPaymentsList), "InvoiceDebitPayments_List"); if (Count != 0) { this.LstSuppliers = invRepository.GetSuppliersList(jsonSearch).ToList(); var sup = LstSuppliers.FirstOrDefault(); if (sup != null) { SelectedSupplierID = sup.SelectedSupplierID; } } } }