示例#1
0
        internal static SupplierInvoiceJournalItem FindSIJournalItemlistForPayment(MySql.Data.MySqlClient.MySqlCommand cmd, int supinvItemID)
        {
            cmd.CommandText = SupplierInvoiceJournalItem.GetByIDSQL(supinvItemID);
            MySql.Data.MySqlClient.MySqlDataReader r      = cmd.ExecuteReader();
            SupplierInvoiceJournalItem             result = SupplierInvoiceJournalItem.TransformReader(r);

            r.Close();
            cmd.CommandText = SupplierInvoiceJournal.GetByIDSQL(result.EVENT_JOURNAL.ID);
            r = cmd.ExecuteReader();
            result.EVENT_JOURNAL = SupplierInvoiceJournal.TransformReader(r);
            r.Close();

            cmd.CommandText = Currency.GetByIDSQLStatic(result.CURRENCY.ID);
            r = cmd.ExecuteReader();
            result.CURRENCY = Currency.GetCurrency(r);
            r.Close();

            cmd.CommandText = TermOfPayment.GetByIDSQLStatic(result.TOP.ID);
            r          = cmd.ExecuteReader();
            result.TOP = TermOfPayment.GetTOP(r);
            r.Close();

            cmd.CommandText = Employee.GetByIDSQLStatic(result.EMPLOYEE.ID);
            r = cmd.ExecuteReader();
            result.EMPLOYEE = Employee.GetEmployee(r);
            r.Close();


            return(result);
        }
示例#2
0
        public override EventJournal FindLastCodeAndTransactionDate(string codesample)
        {
            m_command.CommandText = SupplierInvoiceJournal.FindLastCodeAndTransactionDate(codesample);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            EventJournal e = SupplierInvoiceJournal.TransformReader(r);

            r.Close();
            return(e);
        }
示例#3
0
        public SupplierInvoiceJournal FindPeriodSIJId(int SIId)
        {
            string sql = SupplierInvoiceJournal.FindPeriodSIJId(SIId);

            m_command.CommandText = sql;
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            SupplierInvoiceJournal rest = SupplierInvoiceJournal.TransformReader(r);

            r.Close();
            return(rest);
        }
示例#4
0
        public IList FindSIJournalItemlistForPayment(string find, int ccyID, int supplier, 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 = SupplierInvoiceJournalItem.GetSearchForPayment(find, ccyID, supplier, pois, trdate);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            IList result = SupplierInvoiceJournalItem.TransformReaderList(r);

            r.Close();
            foreach (SupplierInvoiceJournalItem t in result)
            {
                m_command.CommandText = SupplierInvoiceJournal.GetByIDSQL(t.EVENT_JOURNAL.ID);
                r = m_command.ExecuteReader();
                t.EVENT_JOURNAL = SupplierInvoiceJournal.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);
        }
示例#5
0
        protected override EventJournal doGet(int ID)
        {
            m_command.CommandText = SupplierInvoiceJournal.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            SupplierInvoiceJournal st = SupplierInvoiceJournal.TransformReader(r);

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

            r.Close();
            foreach (SupplierInvoiceJournalItem 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);
        }