Exemplo n.º 1
0
        protected override Event doGet(int ID)
        {
            m_command.CommandText = CustomerInvoice.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            CustomerInvoice st = CustomerInvoice.TransformReader(r);

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

            r.Close();
            foreach (CustomerInvoiceItem 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);
                if (sti.DO_ITEM.ID > 0)
                {
                    sti.DO_ITEM = DeliveryOrderRepository.FindDeliveryOrderItem(m_command, sti.DO_ITEM.ID);
                }
                st.EVENT_ITEMS.Add(sti);
            }
            return(st);
        }
Exemplo n.º 2
0
 protected void deleteStockCardEntry(IList sces)
 {
     foreach (StockCardEntry sce in sces)
     {
         StockCardEntryRepository.Delete(m_command, sce);
     }
 }
Exemplo n.º 3
0
 protected void updateStockCards(IList items)
 {
     foreach (EventItem item in items)
     {
         StockCard sc = item.STOCK_CARD;
         if (sc.ID > 0)
         {
             StockCardRepository.UpdateHeader(m_command, sc);
         }
         else if (sc.ID == 0)
         {
             StockCardRepository.SaveHeader(m_command, sc);
         }
         if (item.STOCK_CARD_ENTRY != null)
         {
             StockCardEntryRepository.Save(m_command, item.STOCK_CARD_ENTRY);
         }
     }
 }
Exemplo n.º 4
0
        public OpeningStock GetOpeningStockByNotes(string note)
        {
            m_command.CommandText = OpeningStock.GetByNotesSQL(note);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            OpeningStock st = OpeningStock.TransformReader(r);

            r.Close();
            m_command.CommandText = OpeningStockItem.GetByEventIDSQL(st.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);
        }
Exemplo n.º 5
0
        protected override Event doGet(int ID)
        {
            m_command.CommandText = PurchaseOrder.GetByIDSQL(ID);
            MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader();
            PurchaseOrder st = PurchaseOrder.TransformReader(r);

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

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