private void btnSubmit_Click(object sender, EventArgs e) { if (ValidateChildren()) { VFormBaseMethods.BtnSubmitModel(_id, txtName, WinFormModelTypesList.ModelTypes.VehicleFuelTypeModel); } }
private async void frmVehicleModel_Load(object sender, EventArgs e) { await VFormBaseMethods.LoadAssetToComboBox(cmbManufacturers, _vehicleManufacturerService, WinFormModelTypesList.ModelTypes.VehicleManufacturerModel.ToString()); await LoadVehicleModels(); }
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>()); }
private async void frmVehiclesReport_Load(object sender, EventArgs e) { await VFormBaseMethods.LoadAssetToComboBox(cmbVehicleManufacturer, _vehicleManufacturerService, WinFormModelTypesList.ModelTypes.VehicleManufacturerModel.ToString()); LoadYears(); //await LoadReservations(); }
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(); } }
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(); }
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(); } }
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(); }
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; } }
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 = ""; } }
private void dgvVehicleCategories_MouseDoubleClick(object sender, MouseEventArgs e) { VFormBaseMethods.MouseDoubleClick(WinFormModelTypesList.ModelTypes.VehicleCategoryModel, dgvVehicleCategories); }
private async Task LoadBranch() { await VFormBaseMethods.LoadAssetToComboBox(cmbBranch, _branchService, "BranchModel"); }
private async Task LoadRoles() { await VFormBaseMethods.LoadAssetToComboBox(cmbEmployeeRole, _employeeRoleService, "EmployeeRolesModel"); }
private async void frmClient_Load(object sender, EventArgs e) { await VFormBaseMethods.LoadAssetToComboBox(cmbCountry, new APIService("Country"), "CountryModel"); await LoadClients(); }
private void dgvVehicleTransmissionTypes_MouseDoubleClick(object sender, MouseEventArgs e) { VFormBaseMethods.MouseDoubleClick(WinFormModelTypesList.ModelTypes.VehicleTypeModel, dgvVehicleType); }
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; } }
private void frmAddUpdateVFuelType_Load(object sender, EventArgs e) { VFormBaseMethods.AddOrUpdateModel(_id, txtName, WinFormModelTypesList.ModelTypes.VehicleFuelTypeModel); }
private void dgvVehicleManufacturers_MouseDoubleClick(object sender, MouseEventArgs e) { VFormBaseMethods.MouseDoubleClick(WinFormModelTypesList.ModelTypes.VehicleManufacturerModel, dgvVehicleManufacturers); }
private async Task LoadCountries() { await VFormBaseMethods.LoadAssetToComboBox(cmbCountry, _countryService, "CountryModel"); }