Esempio n. 1
0
        public static OpeningStock GetHeaderOnly(MySql.Data.MySqlClient.MySqlCommand cmd, int poID)
        {
            cmd.CommandText = OpeningStock.GetByIDSQL(poID);
            MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader();
            OpeningStock st = OpeningStock.TransformReader(r);

            r.Close();
            return(st);
        }
Esempio n. 2
0
        protected override Event doGet(int ID)
        {
            m_command.CommandText = OpeningStock.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            OpeningStock st = OpeningStock.TransformReader(r);

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

            r.Close();
            foreach (OpeningStockItem 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);
                st.EVENT_ITEMS.Add(sti);
            }
            return(st);
        }