private void btnClear_Click(object sender, EventArgs e)
 {
     xU_Dispatch.ClearDispatch();
     DriverID.SetEditValue(string.Empty);
     CompanyID.SetEditValue(string.Empty);
     fromDate.DateTime        = DateTime.Now.StartOfWeek();
     toDate.EditValue         = null;
     IncludeCancelled.Checked = false;
 }
Esempio n. 2
0
 public void FormControls(string CLR)
 {
     if (CLR == "CLR")
     {
         DriverID.Enabled            = false;
         DriverName.Enabled          = false;
         DriverAddress.Enabled       = false;
         Drivercity.Enabled          = false;
         DriverContact.Enabled       = false;
         DriverAge.Enabled           = false;
         DriverLicense.Enabled       = false;
         DateJoining.Enabled         = false;
         DriverSalary.Enabled        = false;
         DriverQualification.Enabled = false;
         DriverReference.Enabled     = false;
         DriverConctact2.Enabled     = false;
         DriverID.Clear();
         DriverName.Clear();
         DriverAddress.Clear();
         Drivercity.Clear();
         DriverAge.Clear();
         DriverContact.Clear();
         DriverLicense.Clear();
         DriverSalary.Clear();
         DriverQualification.Clear();
         DriverReference.Clear();
         DriverConctact2.Clear();
         DateJoining.Value = DateTime.Now;
         btnsave.Enabled   = false;
         btnedit.Enabled   = false;
         btndelete.Enabled = false;
         btnadd.Enabled    = true;
         btnfind.Enabled   = true;
         Left1.Enabled     = false;
         Right1.Enabled    = false;
     }
     if (CLR == "Save")
     {
         DriverName.Enabled          = true;
         DriverAddress.Enabled       = true;
         Drivercity.Enabled          = true;
         DriverContact.Enabled       = true;
         DriverAge.Enabled           = true;
         DriverLicense.Enabled       = true;
         DateJoining.Enabled         = true;
         DriverSalary.Enabled        = true;
         DriverQualification.Enabled = true;
         DriverReference.Enabled     = true;
         DriverConctact2.Enabled     = true;
         btnsave.Enabled             = true;
         btnadd.Enabled    = false;
         btnfind.Enabled   = false;
         btndelete.Enabled = false;
         btnedit.Enabled   = false;
     }
 }
        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;
        }
Esempio n. 4
0
        private void btnClear_Click(object sender, EventArgs e)
        {
            btnSearch.Enabled = false;
            btnClear.Enabled  = false;

            DriverID.SetEditValue(string.Empty);
            MedTypeID.SetEditValue(string.Empty);
            ValidityDateFrom.EditValue = DateTime.Now.StartOfMonth();
            ValidityDateTo.EditValue   = DateTime.Now.EndOfMonth();

            btnSearch.Enabled = true;
            btnClear.Enabled  = true;
        }
Esempio n. 5
0
        public async Task <DriverDTO> GetById(DriverID id)
        {
            var driver = await this._repo.GetByIdAsync(id);

            if (driver == null)
            {
                return(null);
            }

            List <string> listDriverTypes = new List <string>();

            foreach (var driverType in driver.driverTypes)
            {
                listDriverTypes.Add(driverType.ToString());
            }

            DriverDTO driverDTO = this._mapper.DomainToDTO(driver, listDriverTypes);

            return(driverDTO);
        }
Esempio n. 6
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);
            }
        }