Ejemplo n.º 1
0
        /// <summary>
        /// Lista el saldo de cartera de Lideres por nit .
        /// </summary>
        /// <param name="Vendedor"></param>
        /// <returns></returns>
        public List <CxCInfo> ListCxCLider(string Lider, string Nit)
        {
            db.SetParameterValue(commandCxC, "i_operation", 'S');
            db.SetParameterValue(commandCxC, "i_option", 'D');
            db.SetParameterValue(commandCxC, "i_lider", Lider);
            db.SetParameterValue(commandCxC, "i_nit", Nit);


            List <CxCInfo> col = new List <CxCInfo>();

            IDataReader dr = null;

            CxCInfo m = null;

            try
            {
                dr = db.ExecuteReader(commandCxC);

                while (dr.Read())
                {
                    m = Factory.GetCxCLider(dr);
                    col.Add(m);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(string.Format("NIVI Error: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name));

                bool rethrow = ExceptionPolicy.HandleException(ex, "DataAccess Policy");

                if (rethrow)
                {
                    throw;
                }
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                }
            }

            return(col);
        }
Ejemplo n.º 2
0
        public List <CxCInfo> ListCxCLider(CxCInfo ObjPedidosCxCInfoRequest)
        {
            List <CxCInfo> lista  = new List <CxCInfo>();;
            CxC            module = new CxC("conexion");

            //--------------------------------------------------------------------------------------------------------


            //--------------------------------------------------------------------------------------------------------
            lista = module.ListCxCLider(ObjPedidosCxCInfoRequest.Lider, ObjPedidosCxCInfoRequest.Nit);


            if (lista != null && lista.Count > 0)
            {
            }
            else
            {
                lista = new List <CxCInfo>();
            }


            return(lista);
        }