Beispiel #1
0
        public CENNotaCreditoDatosPromocion obtenerValoresPromocion(int codigo)
        {
            CADNotaCredito cadNotaCredito    = new CADNotaCredito();
            CENNotaCreditoDatosPromocion obj = null;

            try
            {
                obj = cadNotaCredito.obtenerValoresPromocion(codigo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(obj);
        }
Beispiel #2
0
        public CENNotaCreditoDatosPromocion obtenerValoresPromocion(int codigo)
        {
            SqlConnection con = null;
            SqlCommand    cmd = null;
            SqlDataReader dr  = null;

            CENNotaCreditoDatosPromocion objeto = null;
            //List<CENNotaCreditoDatosVenta> lista = new List<CENNotaCreditoDatosVenta>();
            CADConexion CadCx = new CADConexion();

            try
            {
                con             = new SqlConnection(CadCx.CxSQL());
                cmd             = new SqlCommand("pa_notacredito_habilita_promocion", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add("@p_codigo", SqlDbType.Int).Value = codigo;

                con.Open();
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    objeto       = new CENNotaCreditoDatosPromocion();
                    objeto.valor = Convert.ToDouble(dr["valor"]);
                    objeto.tipo  = Convert.ToInt32(dr["tipo"]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
            return(objeto);
        }