Beispiel #1
0
        public static CENPreventaParametros obtenerParametrosPreventa()
        {
            CADPreventa           cadPreventa = new CADPreventa();
            CENPreventaParametros obj         = null;

            try
            {
                obj = cadPreventa.parametrosPreventa();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(obj);
        }
        public CENPreventaParametros parametrosPreventa()
        {
            SqlConnection con = null;
            SqlCommand    cmd = null;
            SqlDataReader dr  = null;

            CENPreventaParametros obj   = null;
            CADConexion           CadCx = new CADConexion();

            try
            {
                con             = new SqlConnection(CadCx.CxSQL());
                cmd             = new SqlCommand("pa_preventa_parametros", con);
                cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add("@p_codProducto", SqlDbType.VarChar, 50).Value = codProducto;
                con.Open();
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    if (dr["flag"] != DBNull.Value && Convert.ToInt32(dr["flag"].ToString()) == 0)
                    {
                        obj                   = new CENPreventaParametros();
                        obj.igv               = Convert.ToDouble(dr["igv"].ToString());
                        obj.flagRecargo       = Convert.ToInt32(dr["flagRecargo"].ToString());
                        obj.porcentajeRecargo = Convert.ToDouble(dr["porcentajeRecargo"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
            return(obj);
        }