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

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

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

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

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

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