Exemplo n.º 1
0
        public static bool ExistGerente(string codigoNomina)
        {
            bool respuesta = true;

            SO_Gerente sO_Gerente = new SO_Gerente();

            IList informacionBD = sO_Gerente.GetGerente(codigoNomina);

            if (informacionBD != null)
            {
                if (informacionBD.Count == 0)
                {
                    respuesta = false;
                }
            }

            return(respuesta);
        }
Exemplo n.º 2
0
        public static List <DO_Gerente> GetAllGerentes()
        {
            List <DO_Gerente> ListadoGerentes = new List <DO_Gerente>();

            SO_Gerente sO_Gerente = new SO_Gerente();

            IList informacionBD = sO_Gerente.GetAllGerente();

            if (informacionBD != null)
            {
                foreach (var itemGerente in informacionBD)
                {
                    DO_Gerente gerente = new DO_Gerente();

                    Type tipo = itemGerente.GetType();

                    gerente.IdGerente    = (int)tipo.GetProperty("Id").GetValue(itemGerente, null);
                    gerente.CodigoNomina = (string)tipo.GetProperty("CodigoNomina").GetValue(itemGerente, null);
                    gerente.Nombre       = (string)tipo.GetProperty("Nombre").GetValue(itemGerente, null);
                    gerente.Entidad      = (string)tipo.GetProperty("Entidad").GetValue(itemGerente, null);
                    gerente.IsActive     = (bool)tipo.GetProperty("Activo").GetValue(itemGerente, null);

                    if (Convert.ToDateTime(tipo.GetProperty("FechaInicio").GetValue(itemGerente, null)) != DateTime.MinValue)
                    {
                        gerente.FechaInicio = (DateTime)tipo.GetProperty("FechaInicio").GetValue(itemGerente, null);
                    }

                    if (Convert.ToDateTime(tipo.GetProperty("FechaTermino").GetValue(itemGerente, null)) != DateTime.MinValue)
                    {
                        gerente.FechaTermino = (DateTime)tipo.GetProperty("FechaTermino").GetValue(itemGerente, null);
                    }

                    gerente.Cargo = (string)tipo.GetProperty("Cargo").GetValue(itemGerente, null);

                    ListadoGerentes.Add(gerente);
                }
            }

            return(ListadoGerentes);
        }
Exemplo n.º 3
0
        public static int DeleteGerente(int idGerente)
        {
            SO_Gerente sO_Gerente = new SO_Gerente();

            return(sO_Gerente.Delete(idGerente));
        }
Exemplo n.º 4
0
        public static int UpdateGerente(DO_Gerente dO_Gerente)
        {
            SO_Gerente sO_Gerente = new SO_Gerente();

            return(sO_Gerente.Update(dO_Gerente.IdGerente, dO_Gerente.CodigoNomina, dO_Gerente.Nombre, dO_Gerente.Entidad, dO_Gerente.IsActive, dO_Gerente.FechaInicio, dO_Gerente.FechaTermino, dO_Gerente.Cargo));
        }