示例#1
0
        public tb_Cobertura ObtenerCobertura(int idCobertura)
        {
            var cobertura = new tb_Cobertura();

            try
            {
                using (var ctx = new SeguroContext())
                {
                    cobertura = ctx.tb_Cobertura
                                .Where(x => x.IdCobertura == idCobertura)
                                .SingleOrDefault();
                }
            }
            catch (Exception e)
            {
                ELog.save(this, e); //throw;
            }

            return(cobertura);
        }
示例#2
0
        public int ObtenerCobertura1(string descripcionCobertura)
        {
            var coberturaP = new tb_Cobertura();

            try
            {
                using (var ctx = new SeguroContext())
                {
                    coberturaP = ctx.tb_Cobertura
                                 .Where(x => x.DescripcionCobertura.StartsWith(descripcionCobertura))
                                 .SingleOrDefault();
                }
            }
            catch (Exception e)
            {
                ELog.save(this, e); //throw;
            }

            return(coberturaP.IdCobertura);
        }