Example #1
0
        public int CHU_SeguimientoCan_Actualizar(SeguimientoCandidatosBE obj)
        {
            int Result = 0;

            try {
                using (SqlConnection conn = new SqlConnection(RecuperarCadenaDeConexion("coneccionSQL"))) {
                    conn.Open();
                    using (SqlCommand cmd = new SqlCommand(CONST_CHU_SCA_ACTUALIZAR, conn)) {
                        cmd.Parameters.AddWithValue("@Id", obj.Id);
                        cmd.Parameters.AddWithValue("@Id_ENT", obj.Entidades.Id);
                        cmd.Parameters.AddWithValue("@Id_DEP", obj.Departamentos.Id);
                        cmd.Parameters.AddWithValue("@Id_PUE", obj.Puestos.Id);
                        cmd.Parameters.AddWithValue("@Nombre", obj.NombreCompleto);
                        cmd.Parameters.AddWithValue("@Correo", obj.Correo);
                        cmd.Parameters.AddWithValue("@Proceso", obj.Proceso);
                        cmd.Parameters.AddWithValue("@Aceptado", obj.Aceptado);
                        cmd.Parameters.AddWithValue("@IdUsuario", obj.DatosUsuario.IdUsuarioCreo);
                        cmd.Parameters.AddWithValue("@Estatus", obj.DatosUsuario.Estatus);

                        cmd.CommandType = CommandType.StoredProcedure;
                        Result          = Convert.ToInt32(cmd.ExecuteScalar());
                    }
                }
                return(Result);
            } catch (Exception ex) {
                throw ex;
            }
        }
Example #2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            oCHumano = new CapitalHumano.WCF_CHumano.Hersan_CHumanoClient();
            SeguimientoCandidatosBE obj = new SeguimientoCandidatosBE();

            try {
                if (int.Parse(txtId.Text) > 0)
                {
                    if (RadMessageBox.Show("Esta acción dará de baja la solicitud\nDesea continuar...?", this.Text, MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
                    {
                        obj.Id                         = int.Parse(txtId.Text);
                        obj.Entidades.Id               = int.Parse(cboEntidad.SelectedValue.ToString());
                        obj.Puestos.Id                 = int.Parse(cboPuesto.SelectedValue.ToString());
                        obj.Departamentos.Id           = int.Parse(cboDepto.SelectedValue.ToString());
                        obj.Correo                     = (txtCorreo.Text);
                        obj.Proceso                    = true;
                        obj.NombreCompleto             = txtNombreC.Text;
                        obj.DatosUsuario.IdUsuarioCreo = BaseWinBP.UsuarioLogueado.ID;
                        obj.DatosUsuario.Estatus       = false;

                        int Result = oCHumano.CHU_SeguimientoCan_Actualizar(obj);
                        if (Result == 0)
                        {
                            RadMessageBox.Show("Ocurrió un error al modificar los datos", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                        }
                        else
                        {
                            RadMessageBox.Show("Candidato dado de baja correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                            LimpiarCampos();
                            CargarSeguimientos();
                        }
                    }
                }
                else
                {
                    RadMessageBox.Show("No hay ningun candidato seleccionado", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrio un error al dar de baja el candidato\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            } finally {
                oCHumano = null;
            }
        }
Example #3
0
        public List <SeguimientoCandidatosBE> CHU_SeguimientoCan_Obtener()
        {
            List <SeguimientoCandidatosBE> oList = new List <SeguimientoCandidatosBE>();

            try {
                using (SqlConnection conn = new SqlConnection(RecuperarCadenaDeConexion("coneccionSQL"))) {
                    conn.Open();
                    using (SqlCommand cmd = new SqlCommand(CONST_CHU_SCA_OBTENER, conn)) {
                        cmd.CommandType = CommandType.StoredProcedure;
                        using (SqlDataReader reader = cmd.ExecuteReader()) {
                            while (reader.Read())
                            {
                                SeguimientoCandidatosBE obj = new SeguimientoCandidatosBE();

                                obj.Id                   = int.Parse(reader["SCA_Id"].ToString());
                                obj.NombreCompleto       = reader["SCA_NombreCompleto"].ToString();
                                obj.Correo               = reader["SCA_Correo"].ToString();
                                obj.Entidades.Nombre     = (reader["ENT_Nombre"].ToString());
                                obj.Departamentos.Nombre = reader["DEP_Nombre"].ToString();
                                obj.Puestos.Nombre       = reader["PUE_Nombre"].ToString();
                                obj.Entidades.Id         = int.Parse(reader["ENT_Id"].ToString());
                                obj.Departamentos.Id     = int.Parse(reader["DEP_Id"].ToString());
                                obj.Puestos.Id           = int.Parse(reader["PUE_Id"].ToString());
                                obj.Proceso              = bool.Parse(reader["SCA_Proceso"].ToString());
                                obj.Aceptado             = bool.Parse(reader["SCA_Aceptado"].ToString());
                                obj.Rechazado            = !obj.Aceptado;
                                if (bool.Parse(reader["SCA_Proceso"].ToString()) == true)
                                {
                                    obj.Rechazado = obj.Aceptado;
                                }
                                obj.DatosUsuario.Estatus = bool.Parse(reader["SCA_Estatus"].ToString());
                                oList.Add(obj);
                            }
                        }
                    }
                }
                return(oList);
            } catch (Exception ex) {
                throw ex;
            }
        }
Example #4
0
 public int CHU_SeguimientoCan_Actualizar(SeguimientoCandidatosBE obj)
 {
     return(new SeguimientoCandidatosBP().CHU_SeguimientoCan_Actualizar(obj));
 }
Example #5
0
 public int CHU_SeguimientoCan_Guardar(SeguimientoCandidatosBE obj)
 {
     return(new SeguimientoCandidatosBP().CHU_SeguimientoCan_Guardar(obj));
 }
Example #6
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            oCHumano = new CapitalHumano.WCF_CHumano.Hersan_CHumanoClient();
            SeguimientoCandidatosBE obj = new SeguimientoCandidatosBE();

            try {
                if (!ValidarCampos())
                {
                    RadMessageBox.Show("Debe capturar todos los datos para continuar", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                    return;
                }


                #region Entidades
                obj.Id               = int.Parse(txtId.Text);
                obj.Entidades.Id     = int.Parse(cboEntidad.SelectedValue.ToString());
                obj.Puestos.Id       = int.Parse(cboPuesto.SelectedValue.ToString());
                obj.Departamentos.Id = int.Parse(cboDepto.SelectedValue.ToString());
                obj.Correo           = (txtCorreo.Text);
                obj.Proceso          = true;
                if (rdbAceptado.IsChecked)
                {
                    obj.Aceptado = true;
                    obj.Proceso  = false;
                }
                if (rdbRechazado.IsChecked)
                {
                    obj.Rechazado = true;
                    obj.Proceso   = false;
                }

                obj.NombreCompleto             = txtNombreC.Text;
                obj.DatosUsuario.IdUsuarioCreo = BaseWinBP.UsuarioLogueado.ID;
                #endregion



                //PROCESO DE GUARDADO Y ACTUALIZACION
                if (txtId.Text == "-1")
                {
                    int Result = oCHumano.CHU_SeguimientoCan_Guardar(obj);
                    if (Result == 0)
                    {
                        RadMessageBox.Show("Ocurrió un error al enviar la solicitud de empleo", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                    else
                    {
                        RadMessageBox.Show("Solicitud enviada correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                        LimpiarCampos();
                        CargarSeguimientos();
                    }
                }
                else
                {
                    oCHumano = new CapitalHumano.WCF_CHumano.Hersan_CHumanoClient();
                    int Result = oCHumano.CHU_SeguimientoCan_Actualizar(obj);
                    if (Result == 0)
                    {
                        RadMessageBox.Show("Ocurrió un error al actualizar los datos", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                    else
                    {
                        RadMessageBox.Show("Información actualizada correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                        LimpiarCampos();
                        CargarSeguimientos();
                    }
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrio un error al actualizar la información\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            } finally {
                oCHumano = null;
            }
        }