Exemplo n.º 1
0
        public static List <Factura> GetFacturaListForSearch(string whereSql)
        {
            if (string.IsNullOrEmpty(whereSql))
            {
                whereSql = "1 = 1";
            }

            List <Factura>      theList    = new List <Factura>();
            Factura             theUser    = null;
            FacturaTableAdapter theAdapter = new FacturaTableAdapter();

            try
            {
                FacturaDS.FacturaDataTable table = theAdapter.GetFacturaForSearch(whereSql);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (FacturaDS.FacturaRow row in table.Rows)
                    {
                        theUser = FillUserRecord(row);
                        theList.Add(theUser);
                    }
                }
            }
            catch (Exception q)
            {
                log.Error("el error ocurrio mientras obtenia la lista de la Factura de la base de datos", q);
                return(null);
            }
            return(theList);
        }
Exemplo n.º 2
0
        public static Factura GetFacturaById(int IdModulo)
        {
            FacturaTableAdapter localAdapter = new FacturaTableAdapter();

            if (IdModulo <= 0)
            {
                return(null);
            }

            Factura theFactura = null;

            try
            {
                FacturaDS.FacturaDataTable table = localAdapter.GetFacturaById(IdModulo);

                if (table != null && table.Rows.Count > 0)
                {
                    FacturaDS.FacturaRow row = table[0];
                    theFactura = FillUserRecord(row);
                }
            }
            catch (Exception q)
            {
                log.Error("Un error ocurrio mientras obtenia la Factura de la base de dato", q);
                return(null);
            }

            return(theFactura);
        }
Exemplo n.º 3
0
    public static List <Factura> GetListaFacturaVenta()
    {
        List <Factura> theList = new List <Factura>();
        Factura        theData = null;

        try
        {
            FacturaDSTableAdapters.FacturaTableAdapter localAdapter = new FacturaDSTableAdapters.FacturaTableAdapter();
            FacturaDS.FacturaDataTable table = localAdapter.GetListaFacturas(true);

            if (table != null && table.Rows.Count > 0)
            {
                foreach (var row in table)
                {
                    theData = FillReccord(row);
                    theList.Add(theData);
                }
            }
        }
        catch (Exception q)
        {
            throw new ArgumentException(q.Message, q);
        }

        return(theList);
    }
Exemplo n.º 4
0
    public static Factura GetFacturaById(int FacturaId)
    {
        Factura theData = null;

        try
        {
            FacturaDSTableAdapters.FacturaTableAdapter localAdapter = new FacturaDSTableAdapters.FacturaTableAdapter();
            FacturaDS.FacturaDataTable table = localAdapter.GetFacturaById(FacturaId);

            if (table != null && table.Rows.Count > 0)
            {
                FacturaDS.FacturaRow row = table[0];
                theData = FillReccord(row);
            }
        }
        catch (Exception q)
        {
            throw new ArgumentException(q.Message, q);
        }

        return(theData);
    }