コード例 #1
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (ValidateChildren())
     {
         VFormBaseMethods.BtnSubmitModel(_id, txtName, WinFormModelTypesList.ModelTypes.VehicleFuelTypeModel);
     }
 }
コード例 #2
0
        private async void frmVehicleModel_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbManufacturers, _vehicleManufacturerService,
                                                       WinFormModelTypesList.ModelTypes.VehicleManufacturerModel.ToString());

            await LoadVehicleModels();
        }
コード例 #3
0
        private async void frmVehicleType_Load(object sender, EventArgs e)
        {
            var objects = await _service.Get <List <VehicleTypeModel> >(null);

            VFormBaseMethods.baseFormForVehicleReferenceModelsLoad(
                WinFormModelTypesList.ModelTypes.VehicleTypeModel, dgvVehicleType, new List <VehicleCategoryModel>(),
                new List <VehicleFuelTypeModel>(), objects, new List <VehicleManufacturerModel>(),
                new List <VehicleTransmissionTypeModel>());
        }
コード例 #4
0
        private async void frmVehiclesReport_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbVehicleManufacturer, _vehicleManufacturerService,
                                                       WinFormModelTypesList.ModelTypes.VehicleManufacturerModel.ToString());

            LoadYears();

            //await LoadReservations();
        }
コード例 #5
0
        private async void dgvBranch_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var result = await VFormBaseMethods.DeleteContentOnCellClick <BranchModel>(dgvBranch, e,
                                                                                       WinFormModelTypesList.ModelTypes.BranchModel.ToString());

            if (result != null)
            {
                await LoadBranches();
            }
        }
コード例 #6
0
        private async void frmReservation_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbVehicle, _vehicleService,
                                                       WinFormModelTypesList.ModelTypes.VehicleModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbInsurance, _insuranceService,
                                                       WinFormModelTypesList.ModelTypes.InsuranceModel.ToString());

            await LoadReservations();
        }
コード例 #7
0
        private async void dgvVehicle_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var result = await VFormBaseMethods.DeleteContentOnCellClick <OpenRoads.Model.VehicleModel>(dgvVehicle, e,
                                                                                                        WinFormModelTypesList.ModelTypes.VehicleModel.ToString());

            if (result != null)
            {
                await LoadVehicles();
            }
        }
コード例 #8
0
        private async void frmVehicle_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbManufacturer, _vehicleManufacturerService,
                                                       WinFormModelTypesList.ModelTypes.VehicleManufacturerModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbFuel, _vehicleFuelTypeService,
                                                       WinFormModelTypesList.ModelTypes.VehicleFuelTypeModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbTransmission, _vehicleTransmissionService,
                                                       WinFormModelTypesList.ModelTypes.VehicleTransmissionTypeModel.ToString());

            await LoadVehicles();
        }
コード例 #9
0
        private async void frmAddUpdateVehicleModel_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbManufacturer, _vehicleManufacturerService,
                                                       WinFormModelTypesList.ModelTypes.VehicleManufacturerModel.ToString());

            if (_vehicleModelId.HasValue && _vehicleManufacturerId.HasValue)
            {
                var modelObj =
                    await _vehicleModelService.GetById <VehicleModelModel>(int.Parse(_vehicleModelId.ToString()));

                var manufacturerObj =
                    await _vehicleManufacturerService.GetById <VehicleManufacturerModel>(
                        int.Parse(_vehicleManufacturerId.ToString()));

                txtName.Text = modelObj.Name;
                cmbManufacturer.SelectedValue = manufacturerObj.VehicleManufacturerId;
            }
        }
コード例 #10
0
        private async void frmAddUpdateClient_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbCountry, _countryService, "CountryModel");

            if (_clientId.HasValue && _personId.HasValue && _loginDataId.HasValue && _countryId.HasValue)
            {
                var personObj = await _personService.GetById <PersonModel>(_personId);

                var loginDataObj = await _loginDataService.GetById <LoginDataModel>(_loginDataId);

                txtCity.Text             = personObj.City;
                txtPhone.Text            = personObj.PhoneNumber;
                txtAddress.Text          = personObj.Address;
                txtFirstName.Text        = personObj.FirstName;
                txtLastName.Text         = personObj.LastName;
                txtEmail.Text            = personObj.Email;
                cmbCountry.SelectedValue = personObj.CountryId;
                dtpDateOfBirth.Value     = personObj.DateOfBirth;

                txtUsername.Text = loginDataObj.Username;
                txtPassword.Text = "";
            }
        }
コード例 #11
0
 private void dgvVehicleCategories_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     VFormBaseMethods.MouseDoubleClick(WinFormModelTypesList.ModelTypes.VehicleCategoryModel, dgvVehicleCategories);
 }
コード例 #12
0
 private async Task LoadBranch()
 {
     await VFormBaseMethods.LoadAssetToComboBox(cmbBranch, _branchService, "BranchModel");
 }
コード例 #13
0
 private async Task LoadRoles()
 {
     await VFormBaseMethods.LoadAssetToComboBox(cmbEmployeeRole, _employeeRoleService, "EmployeeRolesModel");
 }
コード例 #14
0
        private async void frmClient_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbCountry, new APIService("Country"), "CountryModel");

            await LoadClients();
        }
コード例 #15
0
 private void dgvVehicleTransmissionTypes_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     VFormBaseMethods.MouseDoubleClick(WinFormModelTypesList.ModelTypes.VehicleTypeModel, dgvVehicleType);
 }
コード例 #16
0
        private async void frmAddUpdateVehicle_Load(object sender, EventArgs e)
        {
            await VFormBaseMethods.LoadAssetToComboBox(cmbBranch, _branchService,
                                                       WinFormModelTypesList.ModelTypes.BranchModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbVehicleCategory, _vehicleCategoryService,
                                                       WinFormModelTypesList.ModelTypes.VehicleCategoryModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbVehicleModel, _vehicleModelService,
                                                       WinFormModelTypesList.ModelTypes.VehicleModelModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbFuelType, _vehicleFuelService,
                                                       WinFormModelTypesList.ModelTypes.VehicleFuelTypeModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbTransmissionType, _vehicleTransmissionService,
                                                       WinFormModelTypesList.ModelTypes.VehicleTransmissionTypeModel.ToString());

            await VFormBaseMethods.LoadAssetToComboBox(cmbVehicleType, _vehicleTypeService,
                                                       WinFormModelTypesList.ModelTypes.VehicleTypeModel.ToString());


            if (_vehicleId.HasValue && _fuelId.HasValue && _manufacturerId.HasValue && _transmissionId.HasValue)
            {
                var vehicle = await _vehicleService.GetById <OpenRoads.Model.VehicleModel>(_vehicleId);

                txtPrice.Text            = vehicle.PriceByDay.ToString();
                txtDoors.Text            = vehicle.DoorsCount.ToString();
                txtPowerHp.Text          = vehicle.PowerInHp.ToString();
                txtSeats.Text            = vehicle.SeatsCount.ToString();
                txtRegistrationNr.Text   = vehicle.RegistrationNumber;
                txtManufacturedYear.Text = vehicle.ManufacturedYear.ToString();

                if (vehicle.Picture.Length != 0)
                {
                    if (vehicle.PictureThumb.Length > 0)
                    {
                        byte[] fileNameInBytes = vehicle.PictureThumb;
                        string pictureName     = Encoding.Default.GetString(fileNameInBytes);
                        txtPictureInput.Text = pictureName;
                    }
                    else
                    {
                        txtPictureInput.Text = "";
                    }

                    request.Picture      = vehicle.Picture;
                    request.PictureThumb = vehicle.PictureThumb;

                    MemoryStream ms = new MemoryStream(vehicle.Picture, 0, vehicle.Picture.Length);
                    ms.Write(vehicle.Picture, 0, vehicle.Picture.Length);
                    Image returnImage = Image.FromStream(ms, true);

                    pictureBox1.Image = returnImage;
                }

                cmbBranch.SelectedValue           = vehicle.BranchId;
                cmbVehicleCategory.SelectedValue  = vehicle.VehicleCategoryId;
                cmbVehicleType.SelectedValue      = vehicle.VehicleTypeId;
                cmbFuelType.SelectedValue         = vehicle.VehicleFuelTypeId;
                cmbTransmissionType.SelectedValue = vehicle.VehicleTransmissionTypeId;
                cmbVehicleModel.SelectedValue     = vehicle.VehicleModelId;
            }
        }
コード例 #17
0
 private void frmAddUpdateVFuelType_Load(object sender, EventArgs e)
 {
     VFormBaseMethods.AddOrUpdateModel(_id, txtName, WinFormModelTypesList.ModelTypes.VehicleFuelTypeModel);
 }
コード例 #18
0
 private void dgvVehicleManufacturers_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     VFormBaseMethods.MouseDoubleClick(WinFormModelTypesList.ModelTypes.VehicleManufacturerModel, dgvVehicleManufacturers);
 }
コード例 #19
0
 private async Task LoadCountries()
 {
     await VFormBaseMethods.LoadAssetToComboBox(cmbCountry, _countryService, "CountryModel");
 }