Beispiel #1
0
        public QrAssetViewModel listViewModel(List <Asset> lst, List <QrAssets> listPrint)
        {
            QrAssetViewModel viewModel = new QrAssetViewModel();

            viewModel.lstQr = new List <QrAssets>();
            for (int i = 0; i < lst.Count; i++)
            {
                QrAssets qrAssets = new QrAssets();
                qrAssets.asset     = lst[i];
                qrAssets.isChecked = false;
                viewModel.lstQr.Add(qrAssets);
            }
            try
            {
                for (int i = 0; i < viewModel.lstQr.Count; i++)
                {
                    for (int j = 0; j < listPrint.Count; j++)
                    {
                        if (viewModel.lstQr[i].asset.ID == listPrint[j].asset.ID)
                        {
                            viewModel.lstQr[i].isChecked = true;
                        }
                    }
                }
            }
            catch (Exception e)
            {
            }

            return(viewModel);
        }
Beispiel #2
0
 private bool isExistinList(List <QrAssets> listPrint, QrAssets item)
 {
     foreach (QrAssets a in listPrint)
     {
         if (a.asset.ID == item.asset.ID)
         {
             return(true);
         }
     }
     return(false);
 }