Exemplo n.º 1
0
        public tb_Sexo ObtenerSexo(int idSexo)
        {
            var sexo = new tb_Sexo();

            try
            {
                using (var ctx = new SeguroContext())
                {
                    sexo = ctx.tb_Sexo
                           .Where(x => x.IdSexo == idSexo)
                           .SingleOrDefault();
                }
            }
            catch (Exception e)
            {
                ELog.save(this, e); //throw;
            }

            return(sexo);
        }
Exemplo n.º 2
0
        public int ObtenerSexo(string descripcionSexo)
        {
            var sexo = new tb_Sexo();

            try
            {
                using (var ctx = new SeguroContext())
                {
                    sexo = ctx.tb_Sexo
                           .Where(x => x.DescripcionSexo.StartsWith(descripcionSexo))
                           .SingleOrDefault();
                }
            }
            catch (Exception e)
            {
                ELog.save(this, e); //throw;
            }

            return(sexo.IdSexo);
        }