示例#1
0
        public List <ENDeducibles> GetDeduciblesCompania_xAseguradora(SqlConnection con, int idAseguradora)
        {
            List <ENDeducibles> lbeDeducibles = null;
            SqlCommand          cmd           = new SqlCommand("DBPESPS_Admin_GETDeduciblesLista_xAseguradoraTipo", con);

            cmd.CommandType = CommandType.StoredProcedure;

            //PARAMETER
            DbParameter param = cmd.CreateParameter();

            param.DbType        = DbType.Int32;
            param.ParameterName = "IdAseguradora";
            param.Value         = idAseguradora;
            cmd.Parameters.Add(param);

            SqlDataReader drd = cmd.ExecuteReader(CommandBehavior.SingleResult);

            if (drd != null)
            {
                lbeDeducibles = new List <ENDeducibles>();
                ENDeducibles obeDeducible;
                while (drd.Read())
                {
                    obeDeducible = new ENDeducibles();
                    if (!drd.IsDBNull(0))
                    {
                        obeDeducible.idDeducible = drd.GetInt32(0);
                    }
                    ;
                    if (!drd.IsDBNull(1))
                    {
                        obeDeducible.idAseguradora = drd.GetInt32(1);
                    }
                    ;
                    if (!drd.IsDBNull(2))
                    {
                        obeDeducible.Categoria = drd.GetString(2);
                    }
                    ;
                    if (!drd.IsDBNull(3))
                    {
                        obeDeducible.CoberturaTipo = drd.GetString(3);
                    }
                    ;
                    if (!drd.IsDBNull(4))
                    {
                        obeDeducible.Descripcion = drd.GetString(4);
                    }
                    ;
                    lbeDeducibles.Add(obeDeducible);
                }
                drd.Close();
            }
            return(lbeDeducibles);
        }
示例#2
0
        public ENDeducibles getDeducible_ByID(SqlConnection con, int idDeducible)
        {
            ENDeducibles obeDeducible = new ENDeducibles();
            SqlCommand   cmd          = new SqlCommand("DBPESPS_Admin_GETDeducibleBY_ID", con);

            cmd.CommandType = CommandType.StoredProcedure;

            //ARGUMENTOS DE PROCEDURE
            DbParameter param = cmd.CreateParameter();

            param.DbType        = DbType.Int32;
            param.ParameterName = "@idDeducible";
            param.Value         = idDeducible;
            cmd.Parameters.Add(param);



            SqlDataReader drd = cmd.ExecuteReader(CommandBehavior.SingleResult);

            if (drd != null)
            {
                while (drd.Read())
                {
                    if (!drd.IsDBNull(0))
                    {
                        obeDeducible.idDeducible = drd.GetInt32(0);
                    }
                    ;
                    if (!drd.IsDBNull(1))
                    {
                        obeDeducible.idAseguradora = drd.GetInt32(1);
                    }
                    ;
                    if (!drd.IsDBNull(2))
                    {
                        obeDeducible.Categoria = drd.GetString(2);
                    }
                    ;
                    if (!drd.IsDBNull(3))
                    {
                        obeDeducible.CoberturaTipo = drd.GetString(3);
                    }
                    ;
                    if (!drd.IsDBNull(4))
                    {
                        obeDeducible.Descripcion = drd.GetString(4);
                    }
                    ;
                }
                drd.Close();
            }
            return(obeDeducible);
        }
 public JsonResult getDeducible_ById(int idDeducible)
 {
     try
     {
         ENDeducibles oDeducible   = null;
         LNDeducibles olnDeducible = new LNDeducibles();
         oDeducible = olnDeducible.getDeducible_ByID(idDeducible);
         return(Json(oDeducible, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#4
0
        public List <ENDeducibles> GetDeduciblesCategoriaAll(SqlConnection con)
        {
            List <ENDeducibles> lbeDeducibles = null;
            SqlCommand          cmd           = new SqlCommand("DBPESPS_GetDeduciblesCategoria", con);

            cmd.CommandType = CommandType.StoredProcedure;



            SqlDataReader drd = cmd.ExecuteReader(CommandBehavior.SingleResult);

            if (drd != null)
            {
                lbeDeducibles = new List <ENDeducibles>();
                ENDeducibles obeDeducible;
                while (drd.Read())
                {
                    obeDeducible = new ENDeducibles();
                    if (!drd.IsDBNull(0))
                    {
                        obeDeducible.idDeducible = drd.GetInt32(0);
                    }
                    ;
                    if (!drd.IsDBNull(1))
                    {
                        obeDeducible.idAseguradora = drd.GetInt32(1);
                    }
                    ;
                    if (!drd.IsDBNull(2))
                    {
                        obeDeducible.Categoria = drd.GetString(2);
                    }
                    ;
                    if (!drd.IsDBNull(3))
                    {
                        obeDeducible.CoberturaTipo = drd.GetString(3);
                    }
                    ;
                    if (!drd.IsDBNull(4))
                    {
                        obeDeducible.Descripcion = drd.GetString(4);
                    }
                    ;
                    lbeDeducibles.Add(obeDeducible);
                }
                drd.Close();
            }
            return(lbeDeducibles);
        }
示例#5
0
        public ENDeducibles getDeducible_ByID(int idDeducible)
        {
            ENDeducibles beDeducible = null;

            using (SqlConnection con = new SqlConnection(CadenaConexion))
            {
                try
                {
                    con.Open();
                    DADeducibles odaDeducible = new DADeducibles();
                    beDeducible = odaDeducible.getDeducible_ByID(con, idDeducible);
                }
                catch (Exception ex)
                {
                    GrabarLog(ex);
                }

                return(beDeducible);
            }
        }
        //Actualizacion de Deducibles por IDDeducible
        public JsonResult SaveDeducible_ID(ENDeducibles oDeducible)
        {
            try
            {
                int intRes = 0;
                //GUARDAR DEDUCIBLE
                LNDeducibles oLNDeducible = new LNDeducibles();
                intRes = oLNDeducible.SaveDeducible_TRANS(oDeducible.idDeducible, oDeducible.Descripcion);

                if (intRes > 0)
                {
                    return(Json(new { intDeducible = intRes }));
                }
                else
                {
                    return(Json(new { success = false }));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#7
0
        public List <ENDeducibles> GetDeduciblesCategoria(SqlConnection con, string RIMAC, string MAPFRE, string PACIFICO, string POSITIVA, string HDI)
        {
            List <ENDeducibles> lbeDeducibles = null;
            SqlCommand          cmd           = new SqlCommand("DBPS_GetDeduciblesCategoria", con);

            cmd.CommandType = CommandType.StoredProcedure;

            //RIMAC
            DbParameter param = cmd.CreateParameter();

            param.DbType        = DbType.String;
            param.ParameterName = "@RIMAC_CATEGORIA";
            param.Value         = RIMAC;
            cmd.Parameters.Add(param);


            //MAPFRE
            DbParameter param2 = cmd.CreateParameter();

            param2.DbType        = DbType.String;
            param2.ParameterName = "@MAPFRE_CATEGORIA ";
            param2.Value         = MAPFRE;
            cmd.Parameters.Add(param2);

            //PACIFICO
            DbParameter param3 = cmd.CreateParameter();

            param3.DbType        = DbType.String;
            param3.ParameterName = "@PACIFICO_CATEGORIA ";
            param3.Value         = PACIFICO;
            cmd.Parameters.Add(param3);

            //POSITIVA
            DbParameter param4 = cmd.CreateParameter();

            param4.DbType        = DbType.String;
            param4.ParameterName = "@POSITIVA_CATEGORIA";
            param4.Value         = POSITIVA;
            cmd.Parameters.Add(param4);

            //HDI
            DbParameter param5 = cmd.CreateParameter();

            param5.DbType        = DbType.String;
            param5.ParameterName = "@HDI_CATEGORIA";
            param5.Value         = HDI;
            cmd.Parameters.Add(param5);

            SqlDataReader drd = cmd.ExecuteReader(CommandBehavior.SingleResult);

            if (drd != null)
            {
                lbeDeducibles = new List <ENDeducibles>();
                ENDeducibles obeDeducible;
                while (drd.Read())
                {
                    obeDeducible = new ENDeducibles();
                    if (!drd.IsDBNull(0))
                    {
                        obeDeducible.idDeducible = drd.GetInt32(0);
                    }
                    ;
                    if (!drd.IsDBNull(1))
                    {
                        obeDeducible.idAseguradora = drd.GetInt32(1);
                    }
                    ;
                    if (!drd.IsDBNull(2))
                    {
                        obeDeducible.Categoria = drd.GetString(2);
                    }
                    ;
                    if (!drd.IsDBNull(3))
                    {
                        obeDeducible.CoberturaTipo = drd.GetString(3);
                    }
                    ;
                    if (!drd.IsDBNull(4))
                    {
                        obeDeducible.Descripcion = drd.GetString(4);
                    }
                    ;
                    lbeDeducibles.Add(obeDeducible);
                }
                drd.Close();
            }
            return(lbeDeducibles);
        }