Esempio n. 1
0
        protected override EventJournal doGet(int ID)
        {
            m_command.CommandText = ARCreditNote.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            ARCreditNote st = ARCreditNote.TransformReader(r);

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

            r.Close();
            foreach (ARCreditNoteItem 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);
                if (sti.SALES_RETURN != null)
                {
                    if (sti.SALES_RETURN.ID > 0)
                    {
                        sti.SALES_RETURN = SalesReturnRepository.GetSalesReturnForCreditNote(m_command, sti.SALES_RETURN);
                    }
                }
                st.EVENT_JOURNAL_ITEMS.Add(sti);
            }
            return(st);
        }
Esempio n. 2
0
        public static ARCreditNote FindARCRForReceipt(MySql.Data.MySqlClient.MySqlCommand m_command, int apdnID)
        {
            m_command.CommandText = ARCreditNote.GetByIDSQL(apdnID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            ARCreditNote reuslt = ARCreditNote.TransformReader(r);

            r.Close();
            return(reuslt);
        }
Esempio n. 3
0
        internal static IList FindARCRBySalesReturn(MySql.Data.MySqlClient.MySqlCommand cmd, int prID)
        {
            cmd.CommandText = ARCreditNoteItem.GetARCRItemBySRID(prID);
            MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader();
            IList result = ARCreditNoteItem.TransformReaderList(r);

            r.Close();
            foreach (ARCreditNoteItem i in result)
            {
                cmd.CommandText = ARCreditNote.GetByIDSQL(i.EVENT_JOURNAL.ID);
                r = cmd.ExecuteReader();
                i.EVENT_JOURNAL = ARCreditNote.TransformReader(r);
                r.Close();
            }
            return(result);
        }