public static List <PagoCreditoTarjeta> GetPedidoListUsuarioById(int usuairoId)
        {
            if (usuairoId <= 0)
            {
                return(null);
            }

            List <PagoCreditoTarjeta>      theList    = new List <PagoCreditoTarjeta>();
            PagoCreditoTarjeta             theUser    = null;
            PagoCreditoTarjetaTableAdapter theAdapter = new PagoCreditoTarjetaTableAdapter();

            try
            {
                PagoCreditoTarjetaDS.PagoCreditoTarjetaDataTable table = theAdapter.GetPagoCreditoTarjetaById(usuairoId);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (PagoCreditoTarjetaDS.PagoCreditoTarjetaRow row in table.Rows)
                    {
                        theUser = FillPedidoRecord(row);
                        theList.Add(theUser);
                    }
                }
            }
            catch (Exception q)
            {
                log.Error("el error ocurrio mientras obtenia la lista de los pedido de la base de datos", q);
                return(null);
            }
            return(theList);
        }
        //public static PagoCreditoTarjeta GetPagoCreditoTarjetaByIdUsuario(int UsuarioId)
        //{
        //    PagoCreditoTarjetaTableAdapter localAdapter = new PagoCreditoTarjetaTableAdapter();

        //    if (UsuarioId <= 0)
        //        return null;

        //    PagoCreditoTarjeta theUser = null;

        //    try
        //    {
        //        PagoCreditoTarjetaDS.PagoCreditoTarjetaDataTable table = localAdapter.GetPagoCreditoTarjetaById(UsuarioId);

        //        if (table != null && table.Rows.Count > 0)
        //        {
        //            PagoCreditoTarjetaDS.PagoCreditoTarjetaRow row = table[0];
        //            theUser = FillPedidoRecord(row);
        //        }
        //    }
        //    catch (Exception q)
        //    {
        //        log.Error("An error was ocurred while geting Pedido data", q);
        //        return null;
        //    }

        //    return theUser;
        //}



        public static List <PagoCreditoTarjeta> GetPedidoListForSearch(string whereSql)
        {
            if (string.IsNullOrEmpty(whereSql))
            {
                whereSql = "1 = 1";
            }

            List <PagoCreditoTarjeta>      theList    = new List <PagoCreditoTarjeta>();
            PagoCreditoTarjeta             theUser    = null;
            PagoCreditoTarjetaTableAdapter theAdapter = new PagoCreditoTarjetaTableAdapter();

            try
            {
                PagoCreditoTarjetaDS.PagoCreditoTarjetaDataTable table = theAdapter.GetPagoCreditoTarjetaForSearch(whereSql);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (PagoCreditoTarjetaDS.PagoCreditoTarjetaRow row in table.Rows)
                    {
                        theUser = FillPedidoRecord(row);
                        theList.Add(theUser);
                    }
                }
            }
            catch (Exception q)
            {
                log.Error("el error ocurrio mientras obtenia la lista de los pagos de la base de datos", q);
                return(null);
            }
            return(theList);
        }