Exemplo n.º 1
0
        internal override object[] GetRow()
        {
            MedicalCertList medicalCertList   = MedicalCertList.getInstance();
            MedicalCert     medicalCert       = medicalCertList.getItem(this);
            string          medicalCertStatus = ((medicalCert == null) || (!medicalCert.IsActual())) ? "нет" : "есть";

            LicenseList   licenseList   = LicenseList.getInstance();
            DriverLicense license       = licenseList.getItem(this);
            string        licenseStatus = ((license == null) || (!license.IsActual())) ? "нет" : "есть";

            DriverCarList driverCarList = DriverCarList.getInstance();
            Car           car           = driverCarList.GetCar(this);

            return(new object[]
            {
                Id,
                0,
                GetName(NameType.Full),
                licenseStatus,
                medicalCertStatus,
                (car == null) ? "нет автомобиля" : car.ToString(),
                Region.Name,
                CompanyName,
                Status
            });
        }
Exemplo n.º 2
0
        private void formatDGV()
        {
            dgvMedicalCert.Columns[0].Visible = false;

            foreach (DataGridViewRow row in dgvMedicalCert.Rows)
            {
                int id = 0;
                int.TryParse(row.Cells[0].Value.ToString(), out id);

                MedicalCert medicalCert = _medicalCertList.getItem(id);

                if (medicalCert.IsActual())
                {
                    row.DefaultCellStyle.BackColor = BBColors.bbGreen3;
                }
            }
        }
Exemplo n.º 3
0
        private void FillMedicalCert()
        {
            MedicalCertList medicalCertList = MedicalCertList.getInstance();
            MedicalCert     medicalCert     = medicalCertList.getItem(_driver);

            if (medicalCert != null)
            {
                medicalCertInfo.Text = medicalCert.ToString();
            }
        }
Exemplo n.º 4
0
        private void formatDGV()
        {
            _dgvDrivers.Columns[0].Visible = false;
            ResizeDGV();

            foreach (DataGridViewRow row in _dgvDrivers.Rows)
            {
                int idDriver = 0;
                int.TryParse(row.Cells[0].Value.ToString(), out idDriver);

                Driver driver = driverList.getItem(idDriver);

                LicenseList   licenseList = LicenseList.getInstance();
                DriverLicense license     = licenseList.getItem(driver);

                MedicalCertList medicalCertList = MedicalCertList.getInstance();
                MedicalCert     medicalCert     = medicalCertList.getItem(driver);

                if (!license.IsActual() || !medicalCert.IsActual())
                {
                    row.DefaultCellStyle.BackColor = Color.LightYellow;
                }

                if (driver.Fired)
                {
                    row.DefaultCellStyle.ForeColor = Color.Red;
                }

                if (((driver.OwnerID < 3) && (string.IsNullOrEmpty(driver.Number))) || (driver.Decret))
                {
                    row.DefaultCellStyle.ForeColor = Color.Blue;
                }

                if (driver.OwnerID > 2)
                {
                    row.DefaultCellStyle.ForeColor = BBColors.bbGreen1;
                }
            }
        }