Exemplo n.º 1
0
        private async void frmRoleRequest_Load(object sender, EventArgs e)
        {
            if (_id.HasValue)
            {
                var model = await _roleAPIService.GetById <RoleDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(model, gbxRoleData);
            }
        }
Exemplo n.º 2
0
        private async void frmCategoryRequest_Load(object sender, EventArgs e)
        {
            if (_id.HasValue)
            {
                var model = await _categoryAPIService.GetById <CategoryDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(model, gbxCategoryRequestData);
            }
        }
        private async void frmOrganizationTypeRequest_Load(object sender, EventArgs e)
        {
            if (_id.HasValue)
            {
                var model = await _organizationTypeAPIService.GetById <OrganizationTypeDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(model, gbxOrganizationTypeData);
            }
        }
Exemplo n.º 4
0
        private async void frmCityRequest_Load(object sender, EventArgs e)
        {
            if (cbxCountryId.Items.Count == 0)
            {
                cbxCountryId = await cbxHelper.GetCountries(cbxCountryId);
            }
            if (_id.HasValue)
            {
                var model = await _cityAPIService.GetById <CityDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(model, gbxCityData);
                cbxCountryId.SelectedValue = model.CountryId;
            }
        }
Exemplo n.º 5
0
        private async void frmVehicleTypeRequest_Load(object sender, EventArgs e)
        {
            if (_id.HasValue)
            {
                var result = await _vehicleTypeAPIService.GetById <VehicleTypeDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(result, gbxVehicleTypeData);

                if (request.Icon != null)
                {
                    var image = request.Icon.AsImage();
                    pbxIconPreview.Image = image;
                }
            }
        }
Exemplo n.º 6
0
        private async void frmUserRoleRequest_Load(object sender, EventArgs e)
        {
            if (cbxUserId.Items.Count == 0)
            {
                cbxUserId = await _comboBoxHelper.GetUsers(cbxUserId);
            }
            if (cbxRoleId.Items.Count == 0)
            {
                cbxUserId = await _comboBoxHelper.GetRoles(cbxRoleId);
            }
            if (_id.HasValue)
            {
                var model = await _userRoleAPIService.GetById <UserRoleDTO>(_id.Value);

                ControlsHelper.MapPropsToControls(model, gbxUserRoleData);
            }
        }
Exemplo n.º 7
0
        private async void FrmProductRequest_Load(object sender, EventArgs e)
        {
            if (cbxCategoryId.Items.Count == 0)
            {
                cbxCategoryId = await _comboBoxHelper.GetCategories(cbxCategoryId);
            }

            if (_id.HasValue)
            {
                var productDTO = await _productAPIService.GetById <ProductDTO>(_id);

                ControlsHelper.MapPropsToControls(productDTO, gbxProductData);

                if (productDTO.Photo != null && productDTO.Photo.Length != 0)
                {
                    var image = productDTO.Photo.AsImage();
                    pbxPhoto.Image = image;
                }
            }
        }
Exemplo n.º 8
0
        private async void frmOrganizationRequest_Load(object sender, EventArgs e)
        {
            if (cbxCityId.Items.Count == 0)
            {
                cbxCityId = await comboBoxHelper.GetCities(cbxCityId);
            }
            if (cbxOrganizationTypeId.Items.Count == 0)
            {
                cbxOrganizationTypeId = await comboBoxHelper.GetOrganizationTypes(cbxOrganizationTypeId);
            }
            if (cbxCurrencyId.Items.Count == 0)
            {
                cbxCurrencyId = await comboBoxHelper.GetCurrencies(cbxCurrencyId);
            }

            if (_id.HasValue)
            {
                var organizationDTO = await _organizationAPIService.GetById <OrganizationDTO>(_id);

                ControlsHelper.MapPropsToControls(organizationDTO, gbxOrganizationData);
                ControlsHelper.MapPropsToControls(organizationDTO.User, gbxUserData);
            }
        }