Exemplo n.º 1
0
        //public static APDebitNoteItem FindGRNItem(MySql.Data.MySqlClient.MySqlCommand cmd, int grnIID)
        //{
        //    cmd.CommandText = APDebitNoteItem.FindByGrnItemIDSQL(grnIID);
        //    MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader();
        //    APDebitNoteItem res = APDebitNoteItem.TransformReader(r);
        //    r.Close();
        //    cmd.CommandText = APDebitNote.GetByIDSQL(res.EVENT.ID);
        //    r = cmd.ExecuteReader();
        //    res.EVENT = APDebitNote.TransformReader(r);
        //    r.Close();
        //    return res;
        //}

        protected override IList doSearch(string find)
        {
            try
            {
                m_command.CommandText = APDebitNote.GetSearch(find);
                MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
                IList rest = APDebitNote.TransformReaderList(r);
                r.Close();
                return(rest);
            }
            catch (Exception x)
            {
                throw x;
            }
        }
Exemplo n.º 2
0
        public IList FindAPDNForPayment(int supID, DateTime trdate, string find, IList notInID)
        {
            StringBuilder poisSB = new StringBuilder();

            foreach (int i in notInID)
            {
                poisSB.Append(i.ToString());
                poisSB.Append(',');
            }
            string pois = poisSB.ToString();

            pois = notInID.Count > 0 ? pois.Substring(0, pois.Length - 1) : "";

            m_command.CommandText = APDebitNote.GetForPayment(supID, trdate, find, pois);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            IList reuslt = APDebitNote.TransformReaderList(r);

            r.Close();
            return(reuslt);
        }
Exemplo n.º 3
0
        public IList GetAllTransactions(int supID)
        {
            ArrayList result = new ArrayList();

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

            m_cmd.CommandText = PurchaseOrder.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList po = PurchaseOrder.TransformReaderList(r);

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

            m_cmd.CommandText = GoodReceiveNote.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList grn = GoodReceiveNote.TransformReaderList(r);

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

            m_cmd.CommandText = SupplierInvoice.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList si = SupplierInvoice.TransformReaderList(r);

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

            m_cmd.CommandText = PurchaseReturn.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList pr = PurchaseReturn.TransformReaderList(r);

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

            m_cmd.CommandText = APDebitNote.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList apdn = APDebitNote.TransformReaderList(r);

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

            m_cmd.CommandText = Payment.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList py = Payment.TransformReaderList(r);

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

            m_cmd.CommandText = SupplierOutStandingInvoice.GetBySupplierSQL(supID);
            r = m_cmd.ExecuteReader();
            IList soi = SupplierOutStandingInvoice.TransformReaderList(r);

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

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