Exemple #1
0
        private async void SearchCandidatoView_Load(object sender, EventArgs e)
        {
            _puestos        = (await _puestoService.GetAll()).ToList();
            _capacitaciones = (await _capacitacionService.GetAll()).ToList();
            _competencias   = (await _competenciaService.GetAll()).ToList();
            _departamentos  = (await _departamentoService.GetAll()).ToList();
            _idiomas        = (await _idiomasService.GetAll()).ToList();

            foreach (var departamento in _departamentos)
            {
                DepartamentoComboBox.Items.Add(departamento);
                DepartamentoComboBox.DisplayMember = "Nombre";
                DepartamentoComboBox.ValueMember   = "Id";
            }

            foreach (var idioma in _idiomas)
            {
                IdiomaComboBox.Items.Add(idioma);
                IdiomaComboBox.DisplayMember = "Nombre";
                IdiomaComboBox.ValueMember   = "Id";
            }
        }
        /// <summary>
        /// Returns a view for a "New Product"
        /// </summary>
        /// <returns></returns>
        public ActionResult Novo()
        {
            //Instância das Controllers
            var marcaController = new MarcaController();
            var linhaController = new LinhaController();

            //Instância das Services
            var categoriaService = new CategoriaService();
            var aplicacaoService = new AplicacaoService();
            var idiomaService = new IdiomaService();
            var tipoService = new TipoProdutoService();
            
            //GetAll
            var getAllAplicacoes = aplicacaoService.GetAll();
            var getAllCategorias = categoriaService.GetCategoriesAddMasterCateg();



            var getAllIdiomas = idiomaService.GetAll();
            var getAllTipos = tipoService.GetAll();

            //Adicionando SelectListItens na ViewBag
            ViewBag.Marks = marcaController.GetMarkSelectListItem(new MarcaService().GetAll(), null);
            ViewBag.Lines =
                linhaController.GetLineSelectListItem(new LinhaService()
                                                          .GetAll(), null).OrderBy(x => x.Text).ToList();
            //ViewBag.Skins = tipoPeleController.GetSkinTypeSelectListItem(new TipoPeleService().GetAll(), null);
            ViewBag.Categories = GetProdCategoryListItem(getAllCategorias, null);
            ViewBag.Applications = GetProdAppListItem(getAllAplicacoes, null);
            ViewBag.Types = GetProdTypesListItem(getAllTipos, null);
            ViewBag.Idiomas = getAllIdiomas;
            
            //Adicionando valores selecionados na ViewBag - NULL pois é novo Registro
            ViewBag.selApplications = null;
            ViewBag.selCategories = null;
            ViewBag.selTypes = null;

            return View();
        }
Exemple #3
0
        public ActionResult Index()
        {
            ViewBag.Idiomas = IdiomaService.GetAll();

            return(View());
        }
Exemple #4
0
 private async void update_dataGridView()
 {
     dataGridView1.AutoGenerateColumns = false;
     dataGridView1.DataSource          = (await _idiomaService.GetAll()).ToList();
 }
        // GET: Idioma
        public ActionResult GetIdiomas()
        {
            ViewBag.Idiomas = IdiomaService.GetAll();

            return(PartialView());
        }
        /// <summary>
        /// Returns a view to edit a product
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Editar(int id)
        {
            //Retorna o produto
            var produto = new ProdutoService().GetById(id);

            //Instância das Controllers
            var marcaController = new MarcaController();
            var linhaController = new LinhaController();
            var tipoPeleController = new TipoPeleController();

            //Instância das Services
            var categoriaService = new CategoriaService();
            var aplicacaoService = new AplicacaoService();
            var idiomaService = new IdiomaService();
            var produtoCategoriaService = new ProdutoCategoriaService();
            var produtoAplicacaoService = new ProdutoAplicacaoService();
            var produtoTipoService = new ProdutoTipoProdutoService();
            var tipoService = new TipoProdutoService();

            //GetAll
            var getAllAplicacoes = aplicacaoService.GetAll();
            var getAllCategorias = categoriaService.GetCategoriesAddMasterCateg();
            var getAllIdiomas = idiomaService.GetAll();
            var getAllTipos = tipoService.GetAll();

            //GetByProductId
            var getAllProdutoCategorias = produtoCategoriaService.GetRecords(x => x.IdProduto == produto.IdProduto);
            var getAllProdutoAplicacoes = produtoAplicacaoService.GetRecords(x => x.IdProduto == produto.IdProduto);
            var getAllProdutoTipos = produtoTipoService.GetRecords(x => x.IdProduto == produto.IdProduto);
            
            //Adicionando SelectListItens na ViewBag
            ViewBag.Marks = marcaController.GetMarkSelectListItem(new MarcaService().GetAll(), null);
            ViewBag.Lines = linhaController.GetLineSelectListItem(new LinhaService().GetAll(), null);
            ViewBag.Skins = tipoPeleController.GetSkinTypeSelectListItem(new TipoPeleService().GetAll(), null);
            ViewBag.Categories = GetProdCategoryListItem(getAllCategorias, null);
            ViewBag.Applications = GetProdAppListItem(getAllAplicacoes, produto.IdProduto);
            ViewBag.Types = GetProdTypesListItem(getAllTipos, null);
            ViewBag.Idiomas = getAllIdiomas;

            //Adicionando valores selecionados na ViewBag
            ViewBag.selApplications = CreateApplicationsSelectedList(getAllAplicacoes,
                                                                     getAllProdutoAplicacoes);

            ViewBag.selCategories = CreateCategoriesSelectedList(getAllCategorias,
                                                                 getAllProdutoCategorias);

            ViewBag.selTypes = CreateTypesSelectedList(getAllTipos,
                                                     getAllProdutoTipos);

            return View(produto);
        }