Example #1
0
        //private void checkBookData(BoxerBookData bookData)
        //{
        //    if (bookData == null)
        //    {
        //        FisException ex;
        //        List<string> erpara = new List<string>();
        //        //erpara.Add(sessionKey);
        //        ex = new FisException("CHK158", erpara);
        //        ex.stopWF = false;
        //        throw ex;
        //    }

        //    //CartonSN/PublicKey/MACAddress/PrivateKey/EAN
        //    if (string.IsNullOrEmpty(bookData.CartonSN) || string.IsNullOrEmpty(bookData.PublicKey)
        //        || string.IsNullOrEmpty(bookData.MACAddress) || string.IsNullOrEmpty(bookData.PrivateKey)
        //        || string.IsNullOrEmpty(bookData.EAN))
        //    {
        //        FisException ex;
        //        List<string> erpara = new List<string>();
        //        //erpara.Add(sessionKey);
        //        ex = new FisException("CHK158", erpara);
        //        ex.stopWF = false;
        //        throw ex;
        //    }
        //}

        private void checkTestBoxDataLog(TestBoxDataLog testBoxDataLog)
        {
            if (testBoxDataLog == null)
            {
                FisException ex;
                List<string> erpara = new List<string>();
                //erpara.Add(sessionKey);
                ex = new FisException("CHK158", erpara);
                ex.stopWF = false;
                throw ex;
            }

            //CartonSN/PublicKey/MACAddress/PrivateKey/EAN
            if (string.IsNullOrEmpty(testBoxDataLog.CartonSn) || string.IsNullOrEmpty(testBoxDataLog.PublicKey)
                || string.IsNullOrEmpty(testBoxDataLog.MACAddress) || string.IsNullOrEmpty(testBoxDataLog.PrivateKey)
                || string.IsNullOrEmpty(testBoxDataLog.EAN))
            {
                FisException ex;
                List<string> erpara = new List<string>();
                //erpara.Add(sessionKey);
                ex = new FisException("CHK158", erpara);
                ex.stopWF = false;
                throw ex;
            }
        }
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            

            List<string> cartonNoList = (List<string>)CurrentSession.GetValue(Session.SessionKeys.CartonNoList);
            string cartonNo = cartonNoList[0];

            TestBoxDataLog newData = new TestBoxDataLog();
            newData.CartonSn = cartonNo;
                   

            IProductRepository productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();

            IList<string> ProductCustSNList = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.NewScanedProductCustSNList);
            productRepository.UpdateTestBoxDataLogListDefered(CurrentSession.UnitOfWork, newData, ProductCustSNList);
            

            return base.DoExecute(executionContext);
        }