protected override IList doSearch(string find)
 {
     try
     {
         m_command.CommandText = CustomerInvoice.GetSearch(find);
         MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
         IList rest = CustomerInvoice.TransformReaderList(r);
         r.Close();
         return(rest);
     }
     catch (Exception x)
     {
         throw x;
     }
 }
示例#2
0
        public IList GetAllTransactions(int supID)
        {
            ArrayList result = new ArrayList();

            OpenConnection();
            MySql.Data.MySqlClient.MySqlDataReader r;

            m_cmd.CommandText = SalesOrder.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList po = SalesOrder.TransformReaderList(r);

            r.Close();
            foreach (Event e in po)
            {
                result.Add(e);
            }

            m_cmd.CommandText = DeliveryOrder.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList grn = DeliveryOrder.TransformReaderList(r);

            r.Close();
            foreach (Event e in grn)
            {
                result.Add(e);
            }

            m_cmd.CommandText = CustomerInvoice.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList si = CustomerInvoice.TransformReaderList(r);

            r.Close();
            foreach (Event e in si)
            {
                result.Add(e);
            }

            m_cmd.CommandText = POS.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList pos = POS.TransformReaderList(r);

            r.Close();
            foreach (Event e in pos)
            {
                result.Add(e);
            }

            m_cmd.CommandText = SalesReturn.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList pr = SalesReturn.TransformReaderList(r);

            r.Close();
            foreach (Event e in pr)
            {
                result.Add(e);
            }

            m_cmd.CommandText = ARCreditNote.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList apdn = ARCreditNote.TransformReaderList(r);

            r.Close();
            foreach (EventJournal e in apdn)
            {
                result.Add(e);
            }

            m_cmd.CommandText = Receipt.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList py = Receipt.TransformReaderList(r);

            r.Close();
            foreach (EventJournal e in py)
            {
                result.Add(e);
            }

            m_cmd.CommandText = CustomerOutStandingInvoice.GetByCustomerSQL(supID);
            r = m_cmd.ExecuteReader();
            IList soi = CustomerOutStandingInvoice.TransformReaderList(r);

            r.Close();
            foreach (EventJournal e in soi)
            {
                result.Add(e);
            }

            result.Sort(new EventDateComparer());
            return(result);
        }