Ejemplo n.º 1
0
        public IList FindCOIJournalItemlistForReceipt(string find, int ccyID, int customer, DateTime trdate, IList notIn)
        {
            StringBuilder poisSB = new StringBuilder();

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

            pois = notIn.Count > 0 ? pois.Substring(0, pois.Length - 1) : "";
            m_command.CommandText = CustomerOutStandingInvoiceItem.GetSearchForReceipt(find, ccyID, customer, pois, trdate);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            IList result = CustomerOutStandingInvoiceItem.TransformReaderList(r);

            r.Close();
            foreach (CustomerOutStandingInvoiceItem t in result)
            {
                m_command.CommandText = CustomerOutStandingInvoice.GetByIDSQL(t.EVENT_JOURNAL.ID);
                r = m_command.ExecuteReader();
                t.EVENT_JOURNAL = CustomerOutStandingInvoice.TransformReader(r);
                r.Close();

                m_command.CommandText = Currency.GetByIDSQLStatic(t.CURRENCY.ID);
                r          = m_command.ExecuteReader();
                t.CURRENCY = Currency.GetCurrency(r);
                r.Close();

                m_command.CommandText = TermOfPayment.GetByIDSQLStatic(t.TOP.ID);
                r     = m_command.ExecuteReader();
                t.TOP = TermOfPayment.GetTOP(r);
                r.Close();

                m_command.CommandText = Employee.GetByIDSQLStatic(t.EMPLOYEE.ID);
                r          = m_command.ExecuteReader();
                t.EMPLOYEE = Employee.GetEmployee(r);
                r.Close();
            }
            return(result);
        }
Ejemplo n.º 2
0
        protected override EventJournal doGet(int ID)
        {
            m_command.CommandText = CustomerOutStandingInvoice.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r  = m_command.ExecuteReader();
            CustomerOutStandingInvoice             st = CustomerOutStandingInvoice.TransformReader(r);

            r.Close();
            m_command.CommandText = CustomerOutStandingInvoiceItem.GetByEventIDSQL(ID);
            r = m_command.ExecuteReader();
            IList stis = CustomerOutStandingInvoiceItem.TransformReaderList(r);

            r.Close();
            foreach (CustomerOutStandingInvoiceItem sti in stis)
            {
                sti.EVENT_JOURNAL = st;
                //sti.VENDOR = PartRepository.GetByID(m_command, sti.PART.ID);
                sti.VENDOR_BALANCE_ENTRY = VendorBalanceEntryRepository.FindVendorBalanceEntryByEventItem(m_command, sti.ID, sti.VENDOR_BALANCE_ENTRY_TYPE);
                //sti.GRN_ITEM = GoodReceiveNoteRepository.FindGoodReceiveNoteItem(m_command, sti.GRN_ITEM.ID);
                //sti.GRN_ITEM.PART = PartRepository.GetByID(m_command, sti.GRN_ITEM.PART.ID);
                st.EVENT_JOURNAL_ITEMS.Add(sti);
            }
            return(st);
        }