public void ChangeQrItemInList(int index, string type, string val) { QrItem qr = new QrItem(type, val); qr.NoIncrimented = m_ListQrItems[index].NoIncrimented; m_ListQrItems[index] = qr; }
public bool IsItemContain(QrItem qr) { foreach (DataBaseItem dbi in m_DataBaseItems) { if (dbi.QrItem.Value == qr.Value) { return(true); } } return(false); }
public bool IsItemIsProduct(QrItem qr) { foreach (DictionaryItem di in m_DictionaryDataBase) { if (di.TypeId == qr.Type && di.IsDbProduct) { return(true); } } return(false); }
public bool IsItemIsSerial(QrItem qr) { foreach (DictionaryItem di in m_DictionaryDataBase) { if (di.TypeId == qr.Type && di.IsSerialDb) { return(true); } } return(false); }
public bool IsQrItemInBase(QrItem qrItem) { foreach (DataBase db in m_DataBasesCollection) { foreach (DataBaseItem di in db.DataBaseItems) { if (di.QrItem.Type == qrItem.Type && di.QrItem.Value == qrItem.Value) { return(true); } } } return(false); }
/// <summary> /// возвращает последнее занесенное значение из базы соответствующей параметрам qr кода /// </summary> /// <param name="qrCode"></param> /// <param name="qritem"></param> /// <returns></returns> public string GetLastValueFromDb(QrCodeData qrCode, QrItem qritem) { for (int i = 0; i < m_DataBasesCollection.Count; i++) { foreach (QrItem qr in qrCode.ListQrItems) { if (qr.Type == m_DataBasesCollection[i].TypeDbProdukt.Type && qr.Value == m_DataBasesCollection[i].TypeDbProdukt.Key && qritem.Type == m_DataBasesCollection[i].TypeOfDataSerial) { if (m_DataBasesCollection[i].DataBaseItems.Count > 0) { return(m_DataBasesCollection[i].DataBaseItems[m_DataBasesCollection[i].DataBaseItems.Count - 1].QrItem.Value); } } } } return(null); }
/// <summary> /// Копирует объект в аргументе /// </summary> /// <param name="qr"></param> public QrCodeData(QrCodeData qr) { QrItem[] arr = new QrItem[qr.m_ListQrItems.Count]; qr.ListQrItems.CopyTo(arr); m_ListQrItems = new List <QrItem>(); m_ListQrItems.AddRange(arr); if (qr.ListInPackets != null) { if (qr.ListInPackets.Count > 0) { QrCodeData[] arr_qr = new QrCodeData[qr.ListInPackets.Count]; qr.ListInPackets.CopyTo(arr_qr); m_ListInPackets = new List <QrCodeData>(); m_ListInPackets.AddRange(arr_qr); } } }
/// <summary> /// добавляет qr итем в базу /// </summary> /// <param name="qr"></param> /// <param name="qrData"></param> /// <returns></returns> public bool AddItemInBase(QrItem qr, QrCodeData qrData) { if (qr.Type != m_TypeOfDataSerial) { return(false); } else { foreach (DataBaseItem dbi in m_DataBaseItems) { if (dbi.QrItem.Value == qr.Value) { return(false); } } m_DataBaseItems.Add(new DataBaseItem(qr, qrData.GenerateQrCode(false))); return(true); } }
public void AddQritem(QrItem qr) { m_ListQrItems.Add(qr); }
public DataBaseItem(QrItem q, string qr) { m_QrItem = q; m_QrCode = qr; m_CreationDate = DateTime.Now; }
public QrItemDictionary(QrItem q, string Descr, int len) { m_QrItem = q; m_DataLen = len; m_DictionaryTypeDescription = Descr; }
public QrItemDictionary(QrItem q, int len) { m_QrItem = q; m_DataLen = len; }
public QrItemDictionary(QrItem q, string Descr) { m_QrItem = q; m_DictionaryTypeDescription = Descr; }