Beispiel #1
0
        private void BtnContratar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvCandidatos.CurrentRow != null)
                {
                    var uiCandidato = (BE.UI.Candidato) this.dgvCandidatos.CurrentRow.DataBoundItem;

                    #region Validar Contratacion

                    var activo     = uiCandidato.Activo == "Si" ? true : false;
                    var induccion  = uiCandidato.Induccion == "Si" ? true : false;
                    var disciplina = uiCandidato.Disciplina == "Si" ? true : false;
                    var informe    = uiCandidato.Informe == "Si" ? true : false;
                    var documento  = uiCandidato.Documentacion == "Si" ? true : false;
                    var contratado = uiCandidato.Contratado == "Si" ? true : false;

                    if (activo == false ||
                        induccion == false ||
                        disciplina == false ||
                        informe == false ||
                        documento == false)
                    {
                        Util.ErrorMessage("No cumplio los requisitos para contratación");
                        return;
                    }

                    if (contratado == true)
                    {
                        Util.ErrorMessage("El candidato ya se le contrato");
                        return;
                    }

                    #endregion

                    if (Util.ConfirmationMessage("¿Desea contratar al Candidato seleccionado?") == false)
                    {
                        return;
                    }

                    var frmEmpleadoContratar = new FrmEmpleadoMant();
                    frmEmpleadoContratar.MdiParent = this.MdiParent;
                    frmEmpleadoContratar.Show();

                    var beCandidato = new LN.Candidato().Obtener(uiCandidato.Id);
                    frmEmpleadoContratar.Contratar(beCandidato);

                    frmEmpleadoContratar.frmCandidatoList = this;
                }
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
        }
Beispiel #2
0
 private void btnNuevo_Click(object sender, EventArgs e)
 {
     try
     {
         var frmEmpleadoNew = FrmEmpleadoMant.Instance();
         frmEmpleadoNew.MdiParent = this.MdiParent;
         frmEmpleadoNew.Show();
         frmEmpleadoNew.Cargar(null);
         frmEmpleadoNew.frmEmpleadosList = this;
     }
     catch (Exception ex)
     {
         Util.ErrorMessage(ex.Message);
     }
 }
Beispiel #3
0
        private void Editar(BE.UI.Empleado uiEmpleado)
        {
            try
            {
                var beEmpleado = new LN.Empleado().Obtener(uiEmpleado.Id);

                var frmEmpleadoEdit = FrmEmpleadoMant.Instance();
                frmEmpleadoEdit.MdiParent = this.MdiParent;
                frmEmpleadoEdit.Show();
                frmEmpleadoEdit.Cargar(beEmpleado);
                frmEmpleadoEdit.frmEmpleadosList = this;
            }
            catch (Exception ex)
            {
                throw ex;
                throw;
            }
        }