private void CompanyID_EditValueChanged(object sender, EventArgs e) { uint[] comp = CompanyID.GetCheckedValues(); var loc = this.Manager.GetLocations(comp); LocationID.Properties.DataSource = loc; LocationID.Properties.DropDownRows = loc.Count + 1; }
void CompanyID_EditValueChanging(object sender, ChangingEventArgs e) { CompanyID.EditValueChanging -= CompanyID_EditValueChanging; if (CompanyID.EditValue != null) { uint[] ids = CompanyID.GetCheckedValues(e.NewValue); var locs = LocationRepository.GetLocationsByCompanies(this.DbContext, ids); LocationID.Properties.DataSource = locs; LocationID.Properties.DropDownRows = locs.Count + 1; } CompanyID.EditValueChanging += CompanyID_EditValueChanging; }
private void LoadDispatches() { uint[] drivers = DriverID.GetCheckedValues(); uint[] companies = CompanyID.GetCheckedValues(); DateTime fromDt = fromDate.DateTime; DateTime toDt = toDate.DateTime; bool inCancelled = IncludeCancelled.Checked; int index = gridViewDisp.TopRowIndex; gridControlDisp.DataSource = this.Manager.GetDispatches(drivers, companies, fromDt, toDt, inCancelled); gridViewDisp.TopRowIndex = index; }
private void btnGenerate_Click(object sender, EventArgs e) { if (ReportID.EditValue == null || ReportID.EditValue.ToString() == "0") { Mess.Info("Please select a report!"); ReportID.ShowPopup(); return; } using (var db = DB.GetContext()) { uint reportID = Convert.ToUInt32(ReportID.EditValue); uint[] companies = CompanyID.GetCheckedValues(); uint[] locations = LocationID.GetCheckedValues(); uint[] drivers = DriverID.GetCheckedValues(); DateTime fromDt = FromDate.DateTime; DateTime toDt = ToDate.DateTime; var report = ReportRepository.GenerateReport(db, reportID, companies, locations, drivers, fromDt, toDt); //report.DataSource.WriteXmlSchema("D:\\schema.xml"); ReportBinder.ShowReport(report); } }