예제 #1
0
        public bool Create(List <Area> areasSelec)
        {
            try
            {
                DAL.WFBSEntities    perfilesDC = new DAL.WFBSEntities();
                DAL.PERFIL_DE_CARGO pc         = new PERFIL_DE_CARGO();

                string areas = string.Empty;
                pc.OBSOLETO    = this.Obsoleto;
                pc.DESCRIPCION = this.descripcion;
                foreach (Area a in areasSelec)
                {
                    areas = areas + a.Id_area.ToString() + ",";
                }
                pc.ID_AREAS = areas;

                perfilesDC.PERFIL_DE_CARGO.Add(pc);
                perfilesDC.SaveChanges();
                perfilesDC = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar el Perfil de Cargo: " + ex.ToString());
                return(false);
            }
        }
예제 #2
0
        public bool Update()
        {
            try
            {
                DAL.WFBSEntities user = new DAL.WFBSEntities();
                DAL.USUARIO      us   = user.USUARIO.First(b => b.RUT == this.Rut);

                us.NOMBRE          = this.Nombre;
                us.ID_AREA         = this.Id_Area;
                us.ID_PERFIL       = this.Id_Perfil;
                us.SEXO            = this.Sexo;
                us.JEFE_RESPECTIVO = this.Jefe;
                us.PASSWORD        = this.Password;
                us.OBSOLETO        = this.Obsoleto;

                user.SaveChanges();
                user = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Actualizar el Usuario: " + ex.ToString());
                return(false);
            }
        }
예제 #3
0
        //Crea una nueva instancia de WFBSentities y almacena en esta la nueva instancia de modelo competencia
        public bool Create()
        {
            try
            {
                DAL.WFBSEntities compe = new DAL.WFBSEntities();
                DAL.COMPETENCIA  com   = new COMPETENCIA();

                com.ID_COMPETENCIA        = this.Id_competencia;
                com.NOMBRE                = this.Nombre;
                com.DESCRIPCION           = this.Descripcion;
                com.SIGLA                 = this.Sigla;
                com.OBSOLETA              = this.Obsoleta;
                com.NIVEL_OPTIMO_ESPERADO = this.Nivel_Optimo;
                com.PREGUNTA_ASOCIADA     = this.Pregunta_Asociada;

                compe.COMPETENCIA.Add(com);
                compe.SaveChanges();
                compe = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar la Competencia: " + ex.ToString());
                return(false);
            }
        }
예제 #4
0
        public bool Update(List <Area> areasSelec)
        {
            string areas = string.Empty;

            try
            {
                DAL.WFBSEntities    perfilesDC = new DAL.WFBSEntities();
                DAL.PERFIL_DE_CARGO pc         = perfilesDC.PERFIL_DE_CARGO.First(p => p.ID_PERFIL_DE_CARGO == this.Id_PC);
                pc.ID_PERFIL_DE_CARGO = this.id_perfil_de_cargo;
                pc.DESCRIPCION        = this.descripcion;
                pc.OBSOLETO           = this.Obsoleto;
                foreach (Area a in areasSelec)
                {
                    areas = areas + a.Id_area.ToString() + ",";
                }
                pc.ID_AREAS = areas;
                perfilesDC.SaveChanges();
                perfilesDC = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Actualizar el Perfil de Cargo: " + ex.ToString());
                return(false);
            }
        }
예제 #5
0
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities compe = new DAL.WFBSEntities();
                DAL.COMPETENCIA  com   = compe.COMPETENCIA.First(c => c.ID_COMPETENCIA == this.Id_competencia);

                this.Id_competencia    = Convert.ToInt32(com.ID_COMPETENCIA);
                this.Nombre            = com.NOMBRE;
                this.Descripcion       = com.DESCRIPCION;
                this.Sigla             = com.SIGLA;
                this.Obsoleta          = Convert.ToInt32(com.OBSOLETA);
                this.Nivel_Optimo      = Convert.ToInt32(com.NIVEL_OPTIMO_ESPERADO);
                this.Pregunta_Asociada = com.PREGUNTA_ASOCIADA;
                if (this.Obsoleta == 0)
                {
                    this.Obs = "No";
                }
                else
                {
                    this.Obs = "Si";
                }

                compe = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer la Competencia: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Crea una entidad Área.
        /// </summary>
        /// <param name="comSelec">Recibe un parametro Lista de tipo Competencia</param>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Insert(List <Competencia> comSelec)
        {
            try
            {
                DAL.WFBSEntities modelo = new DAL.WFBSEntities();
                DAL.AREA         ar     = new AREA();
                DAL.COMPETENCIA  c      = new COMPETENCIA();

                ar.ID_AREA     = this._area.ID_AREA;
                ar.NOMBRE      = this._area.NOMBRE;
                ar.ABREVIACION = this._area.ABREVIACION;
                ar.OBSOLETA    = this._area.OBSOLETA;

                modelo.AREA.Add(ar);
                foreach (Competencia item in comSelec)
                {
                    c = modelo.COMPETENCIA.First(b => b.ID_COMPETENCIA == item.ID_COMPETENCIA);
                    ar.COMPETENCIA.Add(c);
                }
                modelo.AREA.Add(ar);
                modelo.SaveChanges();
                modelo = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar el Área:" + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Crea una entidad Área.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Create()
        {
            try
            {
                DAL.WFBSEntities modelo = new DAL.WFBSEntities();
                DAL.EVALUACION   ev     = new DAL.EVALUACION();

                PeriodoEvaluacion          pe   = new PeriodoEvaluacion();
                PeriodoEvaluacionOperacion peOp = new PeriodoEvaluacionOperacion(pe);

                ev.ID_EVALUACION             = this._evaluacion.ID_EVALUACION;
                ev.ID_AREA                   = this._evaluacion.ID_AREA;
                ev.ID_PERIODO_EVALUACION     = peOp.periodoEvaluacionActivo();
                ev.ID_COMPETENCIA            = this._evaluacion.ID_COMPETENCIA;
                ev.RUT_EVALUADO              = this._evaluacion.RUT_EVALUADO;
                ev.RUT_EVALUADOR             = this._evaluacion.RUT_EVALUADOR;
                ev.NOTA_ESPERADA_COMPETENCIA = this._evaluacion.NOTA_ESPERADA_COMPETENCIA;
                ev.FECHA_CONTESTA_ENCUESTA   = this._evaluacion.FECHA_CONTESTA_ENCUESTA;
                ev.NOTA_ENCUESTA             = this._evaluacion.NOTA_ENCUESTA;
                ev.ID_TIPO_EVALUACION        = this._evaluacion.ID_TIPO_EVALUACION;
                modelo.EVALUACION.Add(ev);
                modelo.SaveChanges();
                modelo = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar la evaluación:" + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Lee una entidad Usuario.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities user = new DAL.WFBSEntities();
                DAL.USUARIO      us   = user.USUARIO.First(b => b.RUT == this._usuario.RUT);

                this._usuario.RUT                = us.RUT;
                this._usuario.NOMBRE             = us.NOMBRE;
                this._usuario.SEXO               = us.SEXO;
                this._usuario.ID_PERFIL_DE_CARGO = Convert.ToInt32(us.ID_PERFIL_DE_CARGO);
                this._usuario.ID_PERFIL          = Convert.ToInt32(us.ID_PERFIL);
                this._usuario.JEFE_RESPECTIVO    = us.JEFE_RESPECTIVO;
                this._usuario.PASSWORD           = us.PASSWORD;
                this._usuario.OBSOLETO           = Convert.ToInt32(us.OBSOLETO);

                user = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer el Usuario: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Actualiza una entidad Usuario.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Update()
        {
            try
            {
                DAL.WFBSEntities user = new DAL.WFBSEntities();
                DAL.USUARIO      us   = user.USUARIO.First(b => b.RUT == this._usuario.RUT);

                us.NOMBRE             = this._usuario.NOMBRE;
                us.ID_PERFIL_DE_CARGO = this._usuario.ID_PERFIL_DE_CARGO;
                us.ID_PERFIL          = this._usuario.ID_PERFIL;
                us.SEXO            = this._usuario.SEXO;
                us.JEFE_RESPECTIVO = this._usuario.JEFE_RESPECTIVO;
                us.PASSWORD        = this._usuario.PASSWORD;
                us.OBSOLETO        = this._usuario.OBSOLETO;

                user.SaveChanges();
                user = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Actualizar el Usuario: " + ex.ToString());
                return(false);
            }
        }
예제 #10
0
        public bool Create()
        {
            try
            {
                DAL.WFBSEntities evaluacion = new DAL.WFBSEntities();
                DAL.EVALUACION   ev         = new DAL.EVALUACION();

                ev.ID_EVALUACION             = this.id_evaluacion;
                ev.ID_AREA                   = this.id_area;
                ev.ID_COMPETENCIA            = this.id_competencia;
                ev.ID_PERIODO_EVALUACION     = this.id_periodo_evaluacion;
                ev.ID_TIPO_EVALUACION        = this.id_tipo_evaluacion;
                ev.NOTA_ENCUESTA             = this.nota_encuesta;
                ev.NOTA_ESPERADA_COMPETENCIA = this.nota_esperada;
                ev.RUT_EVALUADO              = this.rut_evaluado;
                ev.RUT_EVALUADOR             = this.rut_evaluador;
                ev.FECHA_CONTESTA_ENCUESTA   = this.fecha_contesta;

                evaluacion.EVALUACION.Add(ev);
                evaluacion.SaveChanges();
                evaluacion = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar evaluación: " + ex.ToString());
                return(false);
            }
        }
예제 #11
0
        public bool ValidarUsuario()
        {
            try
            {
                DAL.WFBSEntities user = new DAL.WFBSEntities();
                DAL.USUARIO      us   = user.USUARIO.First(b => b.RUT == this.Rut && b.PASSWORD == this.Password && b.ID_PERFIL == 1);

                this.Rut       = us.RUT;
                this.Nombre    = us.NOMBRE;
                this.Sexo      = us.SEXO;
                this.Id_Area   = Convert.ToInt32(us.ID_AREA);
                this.Id_Perfil = Convert.ToInt32(us.ID_PERFIL);
                this.Jefe      = us.JEFE_RESPECTIVO;
                this.Password  = us.JEFE_RESPECTIVO;
                this.Obsoleto  = Convert.ToInt32(us.OBSOLETO);

                user = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Validar el Usuario: " + ex.ToString());
                return(false);
            }
        }
예제 #12
0
        /// <summary>
        /// Inserta en la base de datos un perfil de cargo
        /// </summary>
        /// <param name="areasSelec"> Recibe un parametro del tipo entidad Área</param>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Insert(List <Area> areasSelec)
        {
            try
            {
                DAL.WFBSEntities    modelo = new DAL.WFBSEntities();
                DAL.PERFIL_DE_CARGO p      = new PERFIL_DE_CARGO();
                DAL.AREA            a      = new AREA();
                p.DESCRIPCION = this._perfildeCargo.DESCRIPCION;
                p.OBSOLETO    = this._perfildeCargo.OBSOLETO;
                modelo.PERFIL_DE_CARGO.Add(p);
                foreach (Area areaselec in areasSelec)
                {
                    a = modelo.AREA.First(b => b.ID_AREA == areaselec.ID_AREA);
                    p.AREA.Add(a);
                }

                modelo.PERFIL_DE_CARGO.Add(p);
                modelo.SaveChanges();
                modelo = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar el Perfil de Cargo: " + ex.ToString());
                return(false);
            }
        }
예제 #13
0
        /// <summary>
        /// Lee una entidad Área.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities    perfilesDC = new DAL.WFBSEntities();
                DAL.PERFIL_DE_CARGO pc         = perfilesDC.PERFIL_DE_CARGO.First(p => p.ID_PERFIL_DE_CARGO == this._perfildeCargo.ID_PERFIL_DE_CARGO);
                Area          a  = new Area();
                AreaOperacion ao = new AreaOperacion(a);

                this._perfildeCargo.ID_PERFIL_DE_CARGO = Convert.ToInt32(pc.ID_PERFIL_DE_CARGO);
                this._perfildeCargo.DESCRIPCION        = pc.DESCRIPCION;
                this._perfildeCargo.OBSOLETO           = Convert.ToInt32(pc.OBSOLETO);
                string txt = "";
                foreach (AREA item in pc.AREA)
                {
                    txt += item.ID_AREA.ToString() + ",";
                }
                this._perfildeCargo.areas = txt;

                perfilesDC = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer el Perfil de Cargo: " + ex.ToString());
                return(false);
            }
        }
예제 #14
0
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities evaluacion = new DAL.WFBSEntities();
                DAL.EVALUACION   ev         = evaluacion.EVALUACION.First(b => b.ID_EVALUACION == this.id_evaluacion);

                this.id_evaluacion         = ev.ID_EVALUACION;
                this.id_area               = Convert.ToInt32(ev.ID_AREA);
                this.id_competencia        = Convert.ToInt32(ev.ID_COMPETENCIA);
                this.id_periodo_evaluacion = Convert.ToInt32(ev.ID_PERIODO_EVALUACION);
                this.id_tipo_evaluacion    = Convert.ToInt32(ev.ID_TIPO_EVALUACION);
                this.nota_encuesta         = ev.NOTA_ENCUESTA;
                this.nota_esperada         = Convert.ToInt32(ev.NOTA_ESPERADA_COMPETENCIA);
                this.rut_evaluado          = ev.RUT_EVALUADO;
                this.rut_evaluador         = ev.RUT_EVALUADOR;
                this.fecha_contesta        = ev.FECHA_CONTESTA_ENCUESTA;
                evaluacion = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer la Evaluación:" + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Lee una entidad Competencia.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities compe = new DAL.WFBSEntities();
                DAL.COMPETENCIA  com   = compe.COMPETENCIA.First(c => c.ID_COMPETENCIA == this._competencia.ID_COMPETENCIA);

                this._competencia.ID_COMPETENCIA        = Convert.ToInt32(com.ID_COMPETENCIA);
                this._competencia.NOMBRE                = com.NOMBRE;
                this._competencia.DESCRIPCION           = com.DESCRIPCION;
                this._competencia.SIGLA                 = com.SIGLA;
                this._competencia.OBSOLETA              = Convert.ToInt32(com.OBSOLETA);
                this._competencia.NIVEL_OPTIMO_ESPERADO = Convert.ToInt32(com.NIVEL_OPTIMO_ESPERADO);
                this._competencia.PREGUNTA_ASOCIADA     = com.PREGUNTA_ASOCIADA;
                if (this._competencia.OBSOLETA == 0)
                {
                    this._competencia.Obs = "No";
                }
                else
                {
                    this._competencia.Obs = "Si";
                }

                compe = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer la Competencia: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Crea una entidad Competencia.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Create()
        {
            try
            {
                DAL.WFBSEntities compe = new DAL.WFBSEntities();
                DAL.COMPETENCIA  com   = new COMPETENCIA();

                com.ID_COMPETENCIA        = this._competencia.ID_COMPETENCIA;
                com.NOMBRE                = this._competencia.NOMBRE;
                com.DESCRIPCION           = this._competencia.DESCRIPCION;
                com.SIGLA                 = this._competencia.SIGLA;
                com.OBSOLETA              = this._competencia.OBSOLETA;
                com.NIVEL_OPTIMO_ESPERADO = this._competencia.NIVEL_OPTIMO_ESPERADO;
                com.PREGUNTA_ASOCIADA     = this._competencia.PREGUNTA_ASOCIADA;

                compe.COMPETENCIA.Add(com);
                compe.SaveChanges();
                compe = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Agregar la Competencia: " + ex.ToString());
                return(false);
            }
        }
예제 #17
0
        public bool usuarioEvaluado()
        {
            try
            {
                DAL.WFBSEntities evaluacion = new DAL.WFBSEntities();
                DAL.EVALUACION   ev         = evaluacion.EVALUACION.First(b => b.ID_TIPO_EVALUACION == this.id_tipo_evaluacion &&
                                                                          b.ID_PERIODO_EVALUACION == this.id_periodo_evaluacion && b.RUT_EVALUADO == this.rut_evaluado);

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
예제 #18
0
        public int obtener_periodo_evaluacion()
        {
            try
            {
                DAL.WFBSEntities periodo = new DAL.WFBSEntities();

                DAL.PERIODO_EVALUACION pe = periodo.PERIODO_EVALUACION.First(p => p.FECHA_INICIO <= DateTime.Now &&
                                                                             DateTime.Now <= p.FECHA_INICIO.AddDays((double)p.VIGENCIA));

                return((int)pe.ID_PERIODO_EVALUACION);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
예제 #19
0
        public bool Delete()
        {
            try
            {
                DAL.WFBSEntities evaluacion = new DAL.WFBSEntities();
                DAL.EVALUACION   ev         = evaluacion.EVALUACION.First(b => b.ID_EVALUACION == this.id_evaluacion);

                evaluacion.SaveChanges();
                evaluacion = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Desactivar la Área: " + ex.ToString());
                return(false);
            }
        }
예제 #20
0
        /// <summary>
        /// Identifica que periodo de evaluacion se encuentra activo.
        /// </summary>
        /// <returns>Retorna el id del periodo. </returns>
        public int periodoEvaluacionActivo()
        {
            try
            {
                DAL.WFBSEntities periodo = new DAL.WFBSEntities();

                DAL.PERIODO_EVALUACION pe = periodo.PERIODO_EVALUACION.Where(p => p.FECHA_INICIO <= DateTime.Now).ToList().Where
                                                (p => DateTime.Now <= p.FECHA_INICIO.AddDays((double)p.VIGENCIA)).ToList().First();

                return((int)pe.ID_PERIODO_EVALUACION);
            }
            catch (Exception ex)
            {
                Logger.log("No se pudo obtener periodo evaluación activo: " + ex.ToString());
                return(0);
            }
        }
        public List <Competencia> competenciasPerfilC(decimal idpc)
        {
            DAL.WFBSEntities modelo = new DAL.WFBSEntities();
            var pc = modelo.PERFIL_DE_CARGO.First(p => p.ID_PERFIL_DE_CARGO == idpc);
            List <COMPETENCIA> competencias = new List <COMPETENCIA>();

            foreach (AREA item in pc.AREA)
            {
                foreach (COMPETENCIA com in item.COMPETENCIA)
                {
                    competencias.Add(com);
                }
            }
            Competencia          c   = new Competencia();
            CompetenciaOperacion cOp = new CompetenciaOperacion(c);

            return(cOp.GenerarListadoCompetencia(competencias));
        }
예제 #22
0
        public bool Delete()
        {
            try
            {
                DAL.WFBSEntities habi = new DAL.WFBSEntities();
                DAL.HABILIDAD    hab  = habi.HABILIDAD.First(h => h.ID_HABILIDAD == this.Id_Habilidad);

                habi.HABILIDAD.Remove(hab);
                habi.SaveChanges();
                habi = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Eliminar la Habilidad: " + ex.ToString());
                return(false);
            }
        }
예제 #23
0
 public bool Delete()
 {
     try
     {
         DAL.WFBSEntities    perfilesDC = new DAL.WFBSEntities();
         DAL.PERFIL_DE_CARGO pc         = perfilesDC.PERFIL_DE_CARGO.First(p => p.ID_PERFIL_DE_CARGO == this.id_perfil_de_cargo);
         // pcargo.OBSOLETA = 1;
         pc.OBSOLETO = 1;
         perfilesDC.SaveChanges();
         perfilesDC = null;
         return(true);
     }
     catch (Exception ex)
     {
         Log.Logger.log("No se pudo Desactivar el Perfil de Cargo: " + ex.ToString());
         return(false);
     }
 }
        /// <summary>
        /// Identifica a un usuario ya evaluado.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool usuarioEvaluado()
        {
            try
            {
                PeriodoEvaluacion          pe   = new PeriodoEvaluacion();
                PeriodoEvaluacionOperacion peOp = new PeriodoEvaluacionOperacion(pe);
                decimal          pe_act         = peOp.periodoEvaluacionActivo();
                DAL.WFBSEntities evaluacion     = new DAL.WFBSEntities();
                DAL.EVALUACION   ev             = evaluacion.EVALUACION.First(b => b.ID_TIPO_EVALUACION == _evaluacion.ID_TIPO_EVALUACION &&
                                                                              b.ID_PERIODO_EVALUACION == pe_act && b.RUT_EVALUADO == _evaluacion.RUT_EVALUADO);

                return(true);
            }
            catch (Exception ex)
            {
                Logger.log("No se pudo obtener información del usuario: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Desactiva una entidad Competencia.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Delete()
        {
            try
            {
                DAL.WFBSEntities compe = new DAL.WFBSEntities();
                DAL.COMPETENCIA  com   = compe.COMPETENCIA.First(c => c.ID_COMPETENCIA == this._competencia.ID_COMPETENCIA);

                com.OBSOLETA = 1;
                compe.SaveChanges();
                compe = null;

                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Desactivar la Competencia: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Desactiva una entidad Área.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Delete()
        {
            try
            {
                DAL.WFBSEntities area = new DAL.WFBSEntities();
                DAL.AREA         ar   = area.AREA.First(c => c.ID_AREA == this._area.ID_AREA);

                ar.OBSOLETA = 1;

                area.SaveChanges();
                area = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Desactivar el Área: " + ex.ToString());
                return(false);
            }
        }
예제 #27
0
        public bool Delete()
        {
            try
            {
                DAL.WFBSEntities       periodo = new DAL.WFBSEntities();
                DAL.PERIODO_EVALUACION pe      = periodo.PERIODO_EVALUACION.First(b => b.ID_PERIODO_EVALUACION == this.idPeriodo);

                pe.VIGENCIA = 0;

                periodo.SaveChanges();
                periodo = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Desactivar el Periodo de Evaluación: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Desactiva una entidad Usuario.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Delete()
        {
            try
            {
                DAL.WFBSEntities user = new DAL.WFBSEntities();
                DAL.USUARIO      us   = user.USUARIO.First(b => b.RUT == this._usuario.RUT);

                us.OBSOLETO = 1;

                user.SaveChanges();
                user = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Desactivar el Usuario: " + ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// Lee una entidad Área.
        /// </summary>
        /// <returns>Retorna un valor bool acorde a la ejecucion satisfactoria del metodo</returns>
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities area = new DAL.WFBSEntities();
                DAL.AREA         ar   = area.AREA.First(b => b.ID_AREA == this._area.ID_AREA);

                this._area.ID_AREA     = ar.ID_AREA;
                this._area.NOMBRE      = ar.NOMBRE;
                this._area.ABREVIACION = ar.ABREVIACION;
                this._area.OBSOLETA    = ar.OBSOLETA;
                area = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer el Área:" + ex.ToString());
                return(false);
            }
        }
예제 #30
0
        public bool Read()
        {
            try
            {
                DAL.WFBSEntities area = new DAL.WFBSEntities();
                DAL.AREA         ar   = area.AREA.First(b => b.ID_AREA == this.id_area);

                this.id_area     = Convert.ToInt32(ar.ID_AREA);
                this.area        = ar.NOMBRE;
                this.abreviacion = ar.ABREVIACION;
                this.obsoleta    = Convert.ToInt32(ar.OBSOLETA);
                area             = null;
                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.log("No se pudo Leer la Área:" + ex.ToString());
                return(false);
            }
        }