예제 #1
0
        public static System.Collections.Generic.List <Invoiceline> GetInvoiceLineList(int InvoiceID)
        {
            System.Collections.Generic.List <Invoiceline> result = new System.Collections.Generic.List <Invoiceline>();

            DBAccess db = new DBAccess();

            db.AddInt("InvoiceID", InvoiceID);

            SqlDataReader dr = default(SqlDataReader);

            try
            {
                dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectAll));  //CType(db.ExecuteReader(_SQLSelectAllID), SqlDataReader)
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        result.Add(Invoiceline.GetInvoiceLine(System.Convert.ToInt32(dr.DBtoInt("ID"))));
                    }
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return(result);
        }