protected override Event doGet(int ID) { m_command.CommandText = POS.GetByIDSQL(ID); MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader(); POS st = POS.TransformReader(r); r.Close(); m_command.CommandText = POSItem.GetByEventIDSQL(ID); r = m_command.ExecuteReader(); IList stis = POSItem.TransformReaderList(r); r.Close(); foreach (POSItem 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); }
public override Event FindLastCodeAndTransactionDate(string codesample) { m_command.CommandText = POS.FindLastCodeAndTransactionDate(codesample); MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader(); Event e = POS.TransformReader(r); r.Close(); return(e); }
public static POS GetHeaderOnly(MySql.Data.MySqlClient.MySqlCommand cmd, int poID) { cmd.CommandText = POS.GetByIDSQL(poID); MySql.Data.MySqlClient.MySqlDataReader r = cmd.ExecuteReader(); POS st = POS.TransformReader(r); r.Close(); return(st); }
public IList FindSIbyPartAndPONo(string find, IList exceptPOI, int supplierID, DateTime trDate) { StringBuilder poisSB = new StringBuilder(); foreach (int i in exceptPOI) { poisSB.Append(i.ToString()); poisSB.Append(','); } string pois = poisSB.ToString(); pois = exceptPOI.Count > 0?pois.Substring(0, pois.Length - 1):""; m_command.CommandText = POSItem.GetSearchByPartAndPONo(find, supplierID, pois, trDate); MySql.Data.MySqlClient.MySqlDataReader r = m_command.ExecuteReader(); IList result = POSItem.TransformReaderList(r); r.Close(); foreach (POSItem t in result) { m_command.CommandText = POS.GetByIDSQL(t.EVENT.ID); r = m_command.ExecuteReader(); t.EVENT = POS.TransformReader(r); r.Close(); m_command.CommandText = Part.GetByIDSQLStatic(t.PART.ID); r = m_command.ExecuteReader(); t.PART = Part.GetPart(r); r.Close(); m_command.CommandText = Unit.GetByIDSQLstatic(t.UNIT.ID); r = m_command.ExecuteReader(); t.UNIT = Unit.GetUnit(r); r.Close(); m_command.CommandText = TermOfPayment.GetByIDSQLStatic(((POS)t.EVENT).TOP.ID); r = m_command.ExecuteReader(); ((POS)t.EVENT).TOP = TermOfPayment.GetTOP(r); r.Close(); m_command.CommandText = Warehouse.GetByIDSQLStatic(t.WAREHOUSE.ID); r = m_command.ExecuteReader(); t.WAREHOUSE = Warehouse.GetWarehouse(r); r.Close(); m_command.CommandText = Unit.GetByIDSQLstatic(t.PART.UNIT.ID); r = m_command.ExecuteReader(); t.PART.UNIT = Unit.GetUnit(r); r.Close(); } return(result); }