Example #1
0
        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;
        }
Example #2
0
 public bool IsItemContain(QrItem qr)
 {
     foreach (DataBaseItem dbi in m_DataBaseItems)
     {
         if (dbi.QrItem.Value == qr.Value)
         {
             return(true);
         }
     }
     return(false);
 }
Example #3
0
 public bool IsItemIsProduct(QrItem qr)
 {
     foreach (DictionaryItem di in m_DictionaryDataBase)
     {
         if (di.TypeId == qr.Type && di.IsDbProduct)
         {
             return(true);
         }
     }
     return(false);
 }
Example #4
0
 public bool IsItemIsSerial(QrItem qr)
 {
     foreach (DictionaryItem di in m_DictionaryDataBase)
     {
         if (di.TypeId == qr.Type && di.IsSerialDb)
         {
             return(true);
         }
     }
     return(false);
 }
Example #5
0
 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);
 }
Example #6
0
 /// <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);
 }
Example #7
0
        /// <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);
                }
            }
        }
Example #8
0
 /// <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);
     }
 }
Example #9
0
 public void AddQritem(QrItem qr)
 {
     m_ListQrItems.Add(qr);
 }
Example #10
0
 public DataBaseItem(QrItem q, string qr)
 {
     m_QrItem       = q;
     m_QrCode       = qr;
     m_CreationDate = DateTime.Now;
 }
Example #11
0
 public QrItemDictionary(QrItem q, string Descr, int len)
 {
     m_QrItem  = q;
     m_DataLen = len;
     m_DictionaryTypeDescription = Descr;
 }
Example #12
0
 public QrItemDictionary(QrItem q, int len)
 {
     m_QrItem  = q;
     m_DataLen = len;
 }
Example #13
0
 public QrItemDictionary(QrItem q, string Descr)
 {
     m_QrItem = q;
     m_DictionaryTypeDescription = Descr;
 }