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;
        }
示例#2
0
        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);
            }
        }