/// <summary>
 /// Construtor Padrão.
 /// </summary>
 public FilmeBLO()
 {
     _context      = new ContextBibliotecaDeFilme();
     _filmeDAO     = new FilmeDAO(_context);
     _generoDAO    = new GeneroDAO(_context);
     _idiomaDAO    = new IdiomaDAO(_context);
     _nomeFilmeDAO = new NomedoFilmeDAO(_context);
 }
예제 #2
0
        public FrmPaises(Principal principal)
        {
            try
            {
                this.principal = principal;
                FrmUtil        = new FormUtil(principal);
                InitializeComponent();
                Image  image  = Image.FromFile(iconSystem);
                Bitmap bitmap = new Bitmap(image);
                this.Icon = Icon.FromHandle(bitmap.GetHicon());

                FormUtil.Resize(principal, this);

                splitPais.Panel1Collapsed = false;
                splitPais.Panel2Collapsed = true;
                splitPais.Refresh();
                idiomaDAO = new IdiomaDAO();
                paisDAO   = new PaisDAO();

                PopulaData();

                image         = Image.FromFile(actionEdit);
                BtnEdit.Image = image;

                image         = Image.FromFile(actionSave);
                BtnSave.Image = image;

                image          = Image.FromFile(actionClose);
                BtnClose.Image = image;

                image           = Image.FromFile(actionDelete);
                BtnDelete.Image = image;

                image           = Image.FromFile(actionBack);
                BtnVoltar.Image = image;

                image = Image.FromFile(iconPosn);
                ValPosicionar.Image = image;

                image           = Image.FromFile(actionF4Idioma);
                BtnF4Pais.Image = image;

                BtnVoltar.Visible = false;
                BtnEdit.Enabled   = true;
                BtnNew.Enabled    = false;
                BtnSave.Enabled   = false;
                BtnDelete.Enabled = false;
                BtnF4Pais.Enabled = false;

                IsEdit   = false;
                IsInsert = false;
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Erro Paises",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            IdiomaDAO dao = new IdiomaDAO();

            dao.Add(new Idioma()
            {
                Nome  = tbName.Text,
                Sigla = tbSigla.Text,
                Foto  = tbIcon.Text
            });
        }
예제 #4
0
        public DlgFormIdiomas()
        {
            try
            {
                InitializeComponent();

                this.Cursor = Cursors.WaitCursor;

                Image  image  = Image.FromFile(iconSystem);
                Bitmap bitmap = new Bitmap(image);
                this.Icon = Icon.FromHandle(bitmap.GetHicon());

                image            = Image.FromFile(actionDown);
                BtnColapse.Image = image;
                image            = Image.FromFile(actionOK);
                BtnOK.Image      = image;
                image            = Image.FromFile(actionFilter);
                BtnFiltrar.Image = image;
                image            = Image.FromFile(actionClose);
                BtnSair.Image    = image;

                SplitDlgFilter.Panel1Collapsed = true;
                SplitDlgFilter.Panel2Collapsed = false;
                idiomaDAO = new IdiomaDAO();

                idiomas = idiomaDAO.FindByCountAndFilter(50, "", "");
                if (idiomas != null)
                {
                    for (int i = 0; i < idiomas.Count; i++)
                    {
                        DataGridViewRow row = (DataGridViewRow)DataIdiomas.Rows[0].Clone();
                        row.Cells[0].Value           = idiomas[i].Langu;
                        row.Cells[0].ReadOnly        = true;
                        row.Cells[0].Style.BackColor = Color.LightSlateGray;
                        row.Cells[1].Value           = idiomas[i].Denominacao;
                        row.Cells[1].ReadOnly        = true;
                        row.Cells[1].Style.BackColor = Color.LightGray;
                        DataIdiomas.Rows.Add(row);
                    }
                }
                this.Cursor    = Cursors.Default;
                this.CodIdioma = "";
                ValIdioma.Clear();
                ValDescricao.Clear();
                ValLinhas.Text = "50";

                DataIdiomas.AllowUserToAddRows = false;
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Erro Pesquisa Idiomas",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        /// <summary>
        /// Verifica os idiomas, se dados novos foram inseridos, alterados e excluidos e faz as correções necessárias
        /// </summary>
        private void VerificarIdiomas()
        {
            bool      achou  = false;
            IdiomaDAO IdiDao = new IdiomaDAO();

            //Remove dados não válidos
            for (int n = 0; n < CurriculoNovo.Idiomas.Count; n++)
            {
                if (CurriculoNovo.Idiomas[n].Idioma == null)
                {
                    CurriculoNovo.Idiomas.RemoveAt(n);
                }
            }
            //Se o curriculo estava sem Idiomas  todos os dados devem ser inseridos
            if (CurriculoVelho.Idiomas.Count == 0 && CurriculoNovo.Idiomas.Count > 0)
            {
                foreach (IdiomaViewModel form in CurriculoNovo.Idiomas)
                {
                    form.IdCurriculo = CurriculoVelho.Id;
                    IdiDao.Inserir(form);
                }

                return;
            }
            //Verifica uma exclusão de Idiomas ou uma alteração
            foreach (IdiomaViewModel form in CurriculoVelho.Idiomas)
            {
                foreach (IdiomaViewModel form2 in CurriculoNovo.Idiomas)
                {
                    if (form2.Id == form.Id)
                    {
                        if (form2.IdCurriculo == -1)
                        {
                            IdiDao.Excluir(form2.Id, form.IdCurriculo);
                        }
                        else if (IdioChanged(form, form2))
                        {
                            IdiDao.Alterar(form2);
                        }
                        break;
                    }
                }
                // o Id não foi encontrado logo terá que ser excluido
            }
            //verifica inserção de dados
            foreach (IdiomaViewModel form2 in CurriculoNovo.Idiomas)
            {
                if (form2.Id == 0)
                {
                    form2.IdCurriculo = CurriculoVelho.Id;
                    IdiDao.Inserir(form2);
                }
            }
        }
예제 #6
0
파일: FrmIdioma.cs 프로젝트: acegictb/acegi
        public FrmIdioma(Principal principal)
        {
            try
            {
                InitializeComponent();

                this.IsEdit   = false;
                this.IsInsert = false;

                Image  image  = Image.FromFile(iconSystem);
                Bitmap bitmap = new Bitmap(image);
                this.Icon = Icon.FromHandle(bitmap.GetHicon());

                FormUtil.Resize(principal, this);

                idiomaDAO = new IdiomaDAO();

                idiomas = idiomaDAO.FindAllIdioma();

                image         = Image.FromFile(actionEdit);
                BtnEdit.Image = image;

                image = Image.FromFile(iconPosn);
                ValPosicionar.Image = image;

                image         = Image.FromFile(actionSave);
                BtnSave.Image = image;

                image          = Image.FromFile(actionClose);
                BtnClose.Image = image;

                image           = Image.FromFile(actionDelete);
                BtnDelete.Image = image;

                BtnEdit.Enabled   = true;
                BtnNew.Enabled    = false;
                BtnSave.Enabled   = false;
                BtnDelete.Enabled = false;

                this.principal = principal;

                PopulaDados();

                FrmUtil = new FormUtil(principal);
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(DataIdioma, ex.Message, "Erro Idiomas",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void FormLanguage_Load(object sender, EventArgs e)
        {
            listLanguages.Clear();
            listLanguages.Columns.Insert(0, "Nome", 300, HorizontalAlignment.Center);
            listLanguages.Columns.Insert(1, "Sigla", 300, HorizontalAlignment.Center);
            listLanguages.Columns.Insert(1, "Icone", 300, HorizontalAlignment.Center);

            IdiomaDAO dao = new IdiomaDAO();

            foreach (Idioma idioma in dao.Select())
            {
                ListViewItem listItem = listLanguages.Items.Add(idioma.Nome);
                listItem.SubItems.Add(new ListViewItem.ListViewSubItem(null, idioma.Sigla));
                listItem.SubItems.Add(new ListViewItem.ListViewSubItem(null, idioma.Foto));
            }
        }
예제 #8
0
        public DlgIdiomaPosiciona(Principal principal)
        {
            InitializeComponent();

            this.principal = principal;

            idiomaDAO = new IdiomaDAO();

            Image  image  = Image.FromFile(iconSystem);
            Bitmap bitmap = new Bitmap(image);

            this.Icon = Icon.FromHandle(bitmap.GetHicon());

            image           = Image.FromFile(actionF4Idioma);
            BtnFilter.Image = image;
        }
        private void listLanguages_ItemChecked(object sender, ItemCheckedEventArgs e)
        {
            string sigla = "";

            foreach (ListViewItem listItem in listLanguages.CheckedItems)
            {
                sigla = listItem.SubItems[1].Text;
            }

            IdiomaDAO dao = new IdiomaDAO();

            foreach (Idioma idioma in dao.Select())
            {
                if (idioma.Sigla.Equals(sigla))
                {
                    idiomaSelecionado = idioma;
                }
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            CreateDataBase.create();

            /*PessoaDAO dao = new PessoaDAO();
             * foreach(Pessoa p in dao.Select())
             * {
             *  dao.Delete(p);
             * }*/

            /*PerfilDAO dao = new PerfilDAO();
             * if (dao.Select().Count <= 0) {
             *  dao.Add(new Model.Perfil() {
             *      Nome = "Administrador"
             *  });
             *  dao.Add(new Model.Perfil()
             *  {
             *      Nome = "Cliente"
             *  });
             * }
             *
             * IdiomaDAO dao3 = new IdiomaDAO();
             * if (dao3.Select().Count <= 0)
             * {
             *  dao3.Add(new Model.Idioma()
             *  {
             *      Nome = "Português",
             *      Sigla = "pt-BR",
             *      Foto = "portugues"
             *  });
             *  dao3.Add(new Model.Idioma()
             *  {
             *      Nome = "Inglês",
             *      Sigla = "en-US",
             *      Foto = "ingles"
             *  });
             * }*/

            IdiomaDAO dao2 = new IdiomaDAO();

            cbLanguage.Items.Clear();
            cbLanguage.Items.AddRange(dao2.Select().ToArray());
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            IdiomaDAO dao = new IdiomaDAO();

            dao.Delete(idiomaSelecionado);
        }
 /// <summary>
 /// Construtor Padrão.
 /// </summary>
 public IdiomaBLO()
 {
     _context = new ContextBibliotecaDeFilme();
     _idiomaDAO = new IdiomaDAO(_context);
 }
예제 #13
0
 public IdiomaRN()
 {
     dao = new IdiomaDAO();
 }
        private void FormRegisterPerson_Load(object sender, EventArgs e)
        {
            IdiomaDAO dao2 = new IdiomaDAO();

            cbLanguage.Items.Clear();
            cbLanguage.Items.AddRange(dao2.Select().ToArray());

            PerfilDAO dao3 = new PerfilDAO();

            listPerfil.Items.Clear();
            listPerfil.Items.AddRange(dao3.Select().ToArray());

            pbConfirmEmail.Visible = false;
            pbConfirmLogin.Visible = false;
            pbConfirmSenha.Visible = false;
            pbErrorEmail.Visible   = false;
            pbErrorLogin.Visible   = false;
            pbErrorSenha.Visible   = false;

            if (PessoaLogada.Instance.Perfil.Nome.Equals("Administrador"))
            {
                if (isAlter)
                {
                    if (MessageManager.idiomaAtual.Equals("pt-BR"))
                    {
                        btnSave.Text   = "Salvar";
                        btnDelete.Text = "Excluir";
                    }
                    else
                    {
                        btnSave.Text   = "Save";
                        btnDelete.Text = "Delete";
                    }
                }
                else
                {
                    if (MessageManager.idiomaAtual.Equals("pt-BR"))
                    {
                        btnSave.Text   = "Cadastrar";
                        btnDelete.Text = "Voltar";
                    }
                    else
                    {
                        btnSave.Text   = "Register";
                        btnDelete.Text = "Back";
                    }
                }
            }
            else
            {
                lbPerfil.Visible   = false;
                listPerfil.Visible = false;

                if (MessageManager.idiomaAtual.Equals("pt-BR"))
                {
                    btnSave.Text   = "Cadastrar";
                    btnDelete.Text = "Voltar";
                }
                else
                {
                    btnSave.Text   = "Register";
                    btnDelete.Text = "Back";
                }
            }
        }
        public IActionResult Salvar(CurriculoViewModel cur)
        {
            int id;

            try
            {
                ViewBag.Idioma = getSelectedLanguage();
                CurriculoDAO   dao  = new CurriculoDAO();
                FormacaoDAO    fdao = new FormacaoDAO();
                IdiomaDAO      Idao = new IdiomaDAO();
                HabilidadesDAO Hdao = new HabilidadesDAO();
                //cur.Nascimento = Convert.ToDateTime("10/07/1997");
                cur.ImagemEmByte = ConvertImageToByte(cur.Imagem);
                if (dao.Consulta(cur.Id) == null)
                {
                    id = dao.ProximoId();
                    dao.Inserir(cur);
                    if (cur.ImagemEmByte != null)
                    {
                        dao.AlterarImagem(cur.ImagemEmByte, id);
                    }
                    //garante que vai estar no ID correto
                    id = dao.ProximoId() - 1;
                    foreach (FormacaoViewModel f in cur.Formacao)
                    {
                        if (f.Descricao != null && f.Instituicao != null)
                        {
                            f.IdCurriculo = id;
                            fdao.Inserir(f);
                        }
                    }

                    foreach (IdiomaViewModel d in cur.Idiomas)
                    {
                        if (d.Idioma != null)
                        {
                            d.IdCurriculo = id;
                            Idao.Inserir(d);
                        }
                    }

                    foreach (HabilidadesViewModel h in cur.Habilidades)
                    {
                        if (h.Descricao != null)
                        {
                            h.IdCurriculo = id;
                            Hdao.Inserir(h);
                        }
                    }
                }
                else
                {
                    CompareCurriculos Compare = new CompareCurriculos(dao.Consulta(cur.Id), cur);
                    Compare.CompararCurriculo();
                    if (cur.StatusImg == "Editar")
                    {
                        dao.AlterarImagem(cur.ImagemEmByte, cur.Id);
                    }
                }

                return(RedirectToAction("index"));
            }
            catch (Exception erro)
            {
                return(View("Error", new ErrorViewModel(erro.ToString())));
            }
        }