コード例 #1
0
ファイル: SexoBL.cs プロジェクト: JGuerreroT/mio
        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);
        }
コード例 #2
0
ファイル: SexoBL.cs プロジェクト: JGuerreroT/mio
        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);
        }