public static SalesReturn GetHeaderOnly(MySql.Data.MySqlClient.MySqlCommand cmd, int prnID)
        {
            cmd.CommandText = SalesReturn.GetByIDSQL(prnID);
            MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader();
            SalesReturn st = SalesReturn.TransformReader(r);

            r.Close();
            return(st);
        }
        public static SalesReturnItem FindDOItem(MySql.Data.MySqlClient.MySqlCommand cmd, int grnIID)
        {
            cmd.CommandText = SalesReturnItem.FindByDOItemIDSQL(grnIID);
            MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader();
            SalesReturnItem res = SalesReturnItem.TransformReader(r);

            r.Close();
            if (res == null)
            {
                return(null);
            }
            cmd.CommandText = SalesReturn.GetByIDSQL(res.EVENT.ID);
            r         = cmd.ExecuteReader();
            res.EVENT = SalesReturn.TransformReader(r);
            r.Close();
            return(res);
        }
        protected override Event doGet(int ID)
        {
            m_command.CommandText = SalesReturn.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            SalesReturn st = SalesReturn.TransformReader(r);

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

            r.Close();
            foreach (SalesReturnItem sti in stis)
            {
                sti.EVENT            = st;
                sti.PART             = PartRepository.GetByID(m_command, sti.PART.ID);
                sti.STOCK_CARD_ENTRY = StockCardEntryRepository.FindStockCardEntryByEventItem(m_command, sti.ID, sti.STOCK_CARD_ENTRY_TYPE);
                sti.DO_ITEM          = DeliveryOrderRepository.FindDeliveryOrderItem(m_command, sti.DO_ITEM.ID);
                sti.DO_ITEM.PART     = PartRepository.GetByID(m_command, sti.DO_ITEM.PART.ID);
                st.EVENT_ITEMS.Add(sti);
            }
            return(st);
        }