Ejemplo n.º 1
0
        public static IFileBlobManager Create(FileBlobCreationInfoModel creation)
        {
            FileBlobManager manager = new FileBlobManager();
            manager.CreationInfo = creation;
            manager.ActiveModel.DriverID = creation.DriverID;

            return manager;
        }
Ejemplo n.º 2
0
        private void BindModel(DriverModel mod)
        {
            BindingSource bsModel = new BindingSource();
            bsModel.DataSource = mod;

            DriverCode.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.DriverCode), true, DataSourceUpdateMode.OnPropertyChanged);
            FirstName.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.FirstName), true, DataSourceUpdateMode.OnPropertyChanged);
            SecondName.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.SecondName), true, DataSourceUpdateMode.OnPropertyChanged);
            LastName.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.LastName), true, DataSourceUpdateMode.OnPropertyChanged);
            DateOfBirth.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.DateOfBirth), true, DataSourceUpdateMode.OnPropertyChanged);
            DateOfHire.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.DateOfHire), true, DataSourceUpdateMode.OnPropertyChanged);
            CellPhone.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.CellPhone), true, DataSourceUpdateMode.OnPropertyChanged);
            EmergencyPhone.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.EmergencyPhone), true, DataSourceUpdateMode.OnPropertyChanged);
            Email.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.Email), true, DataSourceUpdateMode.OnPropertyChanged);
            //LicenseID.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.LicenseID), true, DataSourceUpdateMode.OnPropertyChanged);
            //LicenseExpirationDate.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.LicenseExpirationDate), true, DataSourceUpdateMode.OnPropertyChanged);
            PayRateOverride.DataBindings.Add("EditValue", bsModel, mod.GetName(p => p.PayRateOverride), true, DataSourceUpdateMode.OnPropertyChanged);
            IsEnabled.DataBindings.Add("Checked", bsModel, mod.GetName(p => p.IsEnabled), true, DataSourceUpdateMode.OnPropertyChanged);

            BindingSource bsLocations = new BindingSource();
            bsLocations.DataSource = mod.Locations;
            gridControlLocations.DataSource = bsLocations;

            FileBlobCreationInfoModel info = new FileBlobCreationInfoModel();
            info.DriverID = this.Manager.ActiveModel.DriverID;
            var manager = FileBlobManager.Create(info);
            xu_Files.Load(manager);

            var driverLicensesManager = DriverLicenseCatalogManager.Create(this.Manager.ActiveModel.DriverID);
            xu_DriverLicenses.LoadManager(driverLicensesManager);
        }