public void setDataSource(Filter filterObj, IEnumerable <string> ConnNo) { InitializeComponent(); this.filterObj = filterObj; BillingDataDataContext db = new BillingDataDataContext(); StartConnNoList = (CollectionViewSource)FindResource("StartConnNoList"); List <String> ConnNoList = ConnNo.OrderBy(x => x).ToList(); StartConnNoList.Source = ConnNoList; EndConnoList = (CollectionViewSource)FindResource("EndConnoList"); EndConnoList.Source = ConnNoList; DataSources.refreshClientList(); List <Client> fClientList = DataSources.ClientCopy; SelectClientBox.AllListSource = fClientList.Where(x => !filterObj.selectedClientList.Select(y => y.CLCODE).Contains(x.CLCODE)).ToList(); SelectClientBox.SelectedListSource = filterObj.selectedClientList; SelectClientBox.DisplayValuePath = "NameAndCode"; switch (filterObj.showBilled) { case true: { BilledRadio.IsChecked = true; break; } case false: { UnBilledRadio.IsChecked = true; break; } case null: { AllRadio.IsChecked = true; break; } } if (filterObj.startConnNo != "" && ConnNo.Contains(filterObj.startConnNo)) { StartConnNo.Text = filterObj.startConnNo; } else { StartConnNo.Text = ConnNo.FirstOrDefault() ?? ""; } if (filterObj.endConnNo != "" && ConnNo.Contains(filterObj.endConnNo)) { EndConnNo.Text = filterObj.endConnNo; } else { EndConnNo.Text = ConnNo.LastOrDefault() ?? ""; } ToDate.SelectedDate = filterObj.toDate; FromDate.SelectedDate = filterObj.fromDate; StartPriceValue.Text = filterObj.startPrice.ToString(); EndPriceValue.Text = filterObj.endPrice.ToString(); StartWeightValue.Text = filterObj.startWeight.ToString(); EndWeightValue.Text = filterObj.endWeight.ToString(); }
private void ReloadCityButton_Click(object sender, RoutedEventArgs e) { DataSources.refreshCityList(); cityViewSource.Source = DataSources.CityCopy; CityDataGrid.Items.Refresh(); }
private void ReloadEmployeeGrid_Click(object sender, RoutedEventArgs e) { DataSources.refreshEmployeeList(); this.employees = DataSources.EmployeeCopy; employeeview.Source = this.employees; }
private void AddClient_close(object sender, EventArgs e) { DataSources.refreshClientList(); clientViewSource.Source = DataSources.ClientCopy; ClientCombo.Items.Refresh(); }
void window_Closed(object sender, EventArgs e) { RefreshDataButton_Click(null, null); DataSources.refreshStockList(); }