Example #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     Product currentProduct = (Product)CurrentSession.GetValue(Session.SessionKeys.Product);
     if (currentProduct.ProductLogs != null)
     {
         foreach (var log in currentProduct.ProductLogs)
         {
             if (string.Compare(log.Station, PakCosmetic) == 0)
             {
                 if (!string.IsNullOrEmpty(log.Line)
                     && !string.IsNullOrEmpty(this.Line)
                     && string.Compare(this.Line.Substring(0, 1), log.Line.Substring(0, 1)) != 0)
                 {
                     //报告错误:“此Product 不应在此线生产! 该Product 在PAK Cosmetic 时选择的线别是” + @Line
                     FisException ex;
                     var erpara = new List<string>();
                     erpara.Add(log.Line);
                     ex = new FisException("CHK868", erpara);   
                     throw ex;
                 }
                 else
                 {
                     return base.DoExecute(executionContext);
                 }
             }
         }
     }
     return base.DoExecute(executionContext);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            string type = (string)CurrentSession.GetValue("VCode");
            string data = (string)CurrentSession.GetValue("DeliveryNo");
            IPizzaRepository repPizza = RepositoryFactory.GetInstance().GetRepository<IPizzaRepository, Pizza>();
            //bool flag=false, flag1=false;

            if (type == "DN")
            {
                return base.DoExecute(executionContext);
            }
             
            if (type == "Shipment")
            {
                if (repPizza.CheckExistPakShipmentWeightFis(data) == false)
                {
                    if (repPizza.CheckExistFisToSpaWeight(data) == true)
                    {
                        repPizza.CopyFisToSapWeightToPakShipmentWeightFisDefered(CurrentSession.UnitOfWork, data);
                    }
                    else {
                        List<string> errpara = new List<string>();
                        errpara.Add("该shipment未称重!");
                        FisException ex = new FisException("CHK275", errpara);
                        throw ex;
                    }
                }               
            }


            return base.DoExecute(executionContext);

        }      
        public void AddITCNDDefectCheck(IMES.DataModel.ITCNDDefectCheckDef item)
        {
            try 
            {
                Boolean existFamily=false;
               ITCNDDefectCheckDef dataLst =itemRepository.CheckExistByFamilyAndCode(item.family,item.code);
                //IList<ITCNDDefectCheckDef> dataLst=GetAllITCNDDefectCheckItems();
                //foreach(ITCNDDefectCheckDef def in dataLst)
                {
                    if (dataLst != null)
                    {
                        FisException fe=null;
                        List<string> param = new List<string>();
                        fe = new FisException("DMT117",param);
                        throw fe;
                    }
                }
            //    if(!existFamily)
                {
                    itemRepository.AddITCNDDefectCheck(item);
                }
            }
            catch(Exception)
            {
                throw;
            }

        }
Example #4
0
        //a)检查Base 的状态为69 ,Status为1(检查Docking 数据库的ProductStatus)        
        public void Check(object partUnit, object bomItem, string station)
        {
            if (partUnit != null)
            {
                string dockingSn = ((PartUnit) partUnit).Sn;
                string dockingPn = ((PartUnit)partUnit).Pn;
                if (!string.IsNullOrEmpty(dockingSn))
                {
                    IProductRepository productRepository =
                        RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
                    DataTable tb = productRepository.ExecSpForQuery(SqlHelper.ConnectionString_PAK, 
                                                                                                "PC_CombineBaseforCheckProductStatus", 
                                                                                                new SqlParameter("DockingSn", dockingSn));

                    if (tb == null || tb.Rows.Count == 0)
                    {
                        List<string> errpara = new List<string>();
                        FisException ex =new FisException("CHK320", errpara);
                        ex.stopWF=false;
                        throw ex;//status is error.
                    }

                    //DataTable tb1 = productRepository.ExecSpForQuery(SqlHelper.ConnectionString_PAK, "PC_CombinePizzaforCheckQCStatus", new SqlParameter("DockingSn", dockingSn));

                    //if (tb1 == null || tb1.Rows.Count == 0)
                    //{
                    //    List<string> errpara = new List<string>();
                    //    FisException ex = new FisException("CHK321", errpara);
                    //    ex.stopWF = false;
                    //    throw ex;//QCstatus is error.
                    //}
                  
                }
            }
        }
Example #5
0
         /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            MB currenMB = CurrentSession.GetValue(Session.SessionKeys.MB) as MB;
            string family = currenMB.Family.Trim();
            string mbCode = currenMB.MBCode.Trim();
            IPCBVersionRepository pcbRep = RepositoryFactory.GetInstance().GetRepository<IPCBVersionRepository>();
            IList<PCBVersion> pcbVerList = pcbRep.GetPCBVersion(family, mbCode);
            CurrentSession.AddValue(ExtendSession.SessionKeys.HasPCBVer, false);
            if (pcbVerList.Count > 0)
            {
                string pcbVer = (string)CurrentSession.GetValue(ExtendSession.SessionKeys.PCBVer);
                if (string.IsNullOrEmpty(pcbVer))
                {
                    FisException e = new FisException("SA002", new string[] { ExtendSession.SessionKeys.PCBVer });
                    throw e;
                }

                PCBVersion pcbVerObj = pcbRep.Find(new string[] { family, mbCode, pcbVer });
                if (pcbVerObj == null)
                {
                    FisException e = new FisException("SA003", new string[] { family, mbCode, pcbVer });
                    throw e;
                }
                currenMB.CUSTVER = pcbVer;
                CurrentSession.AddValue(ExtendSession.SessionKeys.HasPCBVer, true);
                CurrentSession.AddValue(ExtendSession.SessionKeys.Revision, pcbVerObj.CTVer);
                CurrentSession.AddValue(ExtendSession.SessionKeys.Supplier, pcbVerObj.Supplier);
            }
               
            return base.DoExecute(executionContext);
        }
Example #6
0
 /// <summary>
 /// DoExecute
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     //MB
     IMB mb = (IMB)CurrentSession.GetValue(Session.SessionKeys.MB);
      if (mb == null )
     {
         FisException e = new FisException("CHK002", new string[] { });
         e.stopWF = true;
         throw e;
     }
      string fixtureId = (string)CurrentSession.GetValue(Session.SessionKeys.FixtureID);
     if (!IsAllowDoTest(mb.Sn.Substring(0,2), fixtureId) )
     {
         FisException e = new FisException("CHK1098", new string[] { fixtureId, mb.MBCode });
         e.stopWF = true;
         throw e;
     }
    if(!CheckAOI(mb))
    {
        FisException e = new FisException("CHK1099", new string[] {});
         e.stopWF = true;
         throw e;
    }
    return base.DoExecute(executionContext);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     IPizzaRepository repPizza = RepositoryFactory.GetInstance().GetRepository<IPizzaRepository, Pizza>();
     string type = (string)CurrentSession.GetValue("Doc_type");
     //ITC-1360-1090  "Pack List-Shipment"->"Pack List- Shipment"
     //ITC-1360-1136  "Pack List-Shipment"->"Pack List- Shipment"
     if (type == "Pack List- Shipment" || type == "ALL")
     {
         IList<VShipmentPakComnInfo> comnList = (IList<VShipmentPakComnInfo>)CurrentSession.GetValue("ComnList");
         foreach (VShipmentPakComnInfo temp in comnList)
         {
             //if @Doc_Type = 'Pack List- Shipment' and @region = 'NA' and @sales_chan = 'Consumer' 
             //and @order_type = 'CTO' and @intl_carrier = 'FDE'
             if (temp.region == "NA" && temp.sales_chan == "Consumer"
                 && temp.order_type == "CTO" && temp.intl_carrier == "FDE")
             {
                 string data = (string)CurrentSession.GetValue("Data");
                 bool bExist = false;
                 //exists (select * from dbo.PAK_PackkingData nolock where InternalID = @deliveryno and TRACK_NO_PARCEL <> '')
                 bExist = repPizza.CheckExistPakPackkingData(data);
                 if (bExist == false)
                 {
                     FisException ex;
                     List<string> erpara = new List<string>();
                     erpara.Add(data);
                     ex = new FisException("CHK826", erpara);
                     //ex.stopWF = false;
                     throw ex;
                 }
             }
         }
     }
     return base.DoExecute(executionContext);
 }
Example #8
0
        public void AddCustomer(CustomerInfo customerInfo)
        {
            FisException ex;
            List<string> paraError = new List<string>();

            try
            {
                IMiscRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>();

                if (itemRepository.GetCustomerInfo(customerInfo.customer) == null)
                {
                    UnitOfWork uow = new UnitOfWork();
                    itemRepository.AddCustomerDefered(uow, customerInfo);
                    uow.Commit();
                }
                else
                {
                    ex = new FisException("DMT056", paraError);
                    throw ex;
                }
            }
            catch (Exception)
            {
                throw;
            }

        }
Example #9
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     bool existDDRCT = false;
     string ddrct = CurrentSession.GetValue("DDRCT") as string;
     if (null != ddrct){
         Product currentProduct = ((Product)CurrentSession.GetValue(Session.SessionKeys.Product));
         IList<IProductPart> productParts = currentProduct.ProductParts;
         foreach (ProductPart part in productParts)
         {
             if ("DDR".Equals(part.CheckItemType) && ddrct.Equals(part.PartSn))
             {
                 existDDRCT = true;
                 break;
             }
         }
     }
     if (!existDDRCT)
     {
         List<string> errpara = new List<string>();
         FisException e = new FisException("CHK1014", errpara); // 请核对流程卡
         throw e;
     }
     
     return base.DoExecute(executionContext);
 }
Example #10
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {

            //从Session里取得Product对象
            Product currentProduct = (Product)CurrentSession.GetValue(Session.SessionKeys.Product);

            if (String.IsNullOrEmpty(currentProduct.Status.StationId))
            {
                FisException ex;
                List<string> erpara = new List<string>();
                ex = new FisException("CHK809", erpara);
                throw ex;
            }
            if(currentProduct.Status.StationId == "99")
            {
                FisException ex;
                List<string> erpara = new List<string>();                
                ex = new FisException("CHK810", erpara);
                throw ex;
            }
            else
            {
            }

            return base.DoExecute(executionContext);
        }
Example #11
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {

            string model1 = (string)CurrentSession.GetValue(Session.SessionKeys.Model1);
            string model2 = (string)CurrentSession.GetValue(Session.SessionKeys.Model2);

            ASTInfo info = (ASTInfo)CurrentSession.GetValue(Session.SessionKeys.ASTInfoList);

            if (model1 != model2)
            {
                IBOMRepository ibomRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.FisBOM.IBOMRepository>();

                MoBOMInfo cond = new MoBOMInfo();
                cond.material = model2;
                cond.component = info.PartNo;
                cond.flag = 1;
                IList<MoBOMInfo> list = new List<MoBOMInfo>();
                list = ibomRepository.GetModelBomList(cond);
                if (list == null || list.Count == 0)
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    ex = new FisException("CHK895", erpara);
                    throw ex;
                }
            }
            
            return base.DoExecute(executionContext);
        }
Example #12
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            //Left(Product.Model,3)=’173’
            //1)Model下阶BM阶的描述包含LCM,该Product不存在Product_Part.PartSn like ‘C%’ and Product_Part.BomNodeType=’KP’的数据,则报错:“请去结合LCM”

            var currentProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            var model = currentProduct.Model;
            if (model.IndexOf("173") == 0)
            {
                IBOMRepository ibomRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.FisBOM.IBOMRepository>();
                IList<MoBOMInfo> list = new List<MoBOMInfo>();
                list = ibomRepository.GetPnListByModelAndBomNodeTypeAndDescr(model, "BM", "LCM");
                if (list != null && list.Count > 0)
                {
                    IProductRepository currentProductRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
                    IList<ProductPart> partList = currentProductRepository.GetProductPartByBomNodeTypeAndPartSnLike(currentProduct.ProId, "KP", "C");

                    if (partList == null || partList.Count <= 0)
                    {
                        FisException ex;
                        List<string> erpara = new List<string>();
                        ex = new FisException("CHK948", erpara);
                        throw ex;

                    }

                }
            }
            
            return base.DoExecute(executionContext);
        }
Example #13
0
        public void deleteMB_Test(string code, string family, bool type)
        {
            IList<MBTestDef> lstMBtestDef = new List<MBTestDef>();
            lstMBtestDef = itestMB.GetMBTestByCodeFamilyAndType(code, family, type);
            try
            {

                if (lstMBtestDef == null || lstMBtestDef.Count <= 0)
                {   //已经不存在此testMb记录,不能删除
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT114", erpara);
                    throw ex;
                }
                else
                {
                    itestMB.DeleteMBTest(code, family, type);
                }
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Example #14
0
        /// <summary>
        /// Check Product Is CleanRoom
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var currentProduct = CurrentSession.GetValue(Session.SessionKeys.Product) as IProduct;
            if (currentProduct == null)
            {
                var ex1 = new FisException("SFC002", new string[] { "" });
                throw ex1;
            }

            CurrentSession.AddValue(CheckedResultVariable, "N");

            IProductRepository prodRep = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IMES.FisObject.FA.Product.IProduct>();
          //  IList<ProductPart> pp = prodRep.GetProductPartByPartTypeLike(currentProduct.ProId, "Clean Room");
              IList<ProductPart> pp = prodRep.GetProductPartByPartTypeLike(currentProduct.ProId, "LCM");
            if (pp != null && pp.Count > 0)
            {
                IProduct cleanroomProduct = prodRep.GetProductByIdOrSn(pp[0].PartSn);
                if (cleanroomProduct != null)
                {
                    CurrentSession.AddValue(CheckedResultVariable, "Y");
                    CurrentSession.AddValue("Backup" + Session.SessionKeys.Product, currentProduct);
                    CurrentSession.AddValue(Session.SessionKeys.Product, cleanroomProduct);
                }
            }

            return base.DoExecute(executionContext);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            string data = (string)CurrentSession.GetValue("DeliveryNo");
            IPizzaRepository repPizza = RepositoryFactory.GetInstance().GetRepository<IPizzaRepository, Pizza>();
            bool flag = false;            
            flag = repPizza.CheckExistPakDashPakComnByInternalID(data.Substring(0,10));

            if (flag == true)
            {
                CurrentSession.AddValue(Session.SessionKeys.VCode, "DN");
                CurrentSession.AddValue(Session.SessionKeys.DeliveryNo, data.Substring(0, 10));
                return base.DoExecute(executionContext);                
            }
            
            flag = repPizza.CheckExistVShipmentPakComnByConsolInvoiceOrShipment(data);
            if (flag == true)
            {
                CurrentSession.AddValue(Session.SessionKeys.VCode, "Shipment");
                return base.DoExecute(executionContext);                
            }
            
            CurrentSession.AddValue(Session.SessionKeys.VCode, "Unknown");
            List<string> errpara = new List<string>();
            errpara.Add(data);
            FisException ex = new FisException("CHK277", errpara);
            //ex.stopWF = false;
            throw ex;

        }        
Example #16
0
        /// <summary>
        /// check CUST SN是否为空或未产生
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {          
            Product curProduct = (Product)CurrentSession.GetValue(Session.SessionKeys.Product);

            PrintLog condition = new PrintLog();
            condition.Name = curProduct.Customer + "SNO";
            condition.BeginNo = curProduct.ProId;

            var repository = RepositoryFactory.GetInstance().GetRepository<IPrintLogRepository, PrintLog>();
            IList<PrintLog> printLogList = repository.GetPrintLogListByCondition(condition);

            FisException ex;
            List<string> erpara = new List<string>();
            if (printLogList.Count == 0)
            {
                erpara.Add(curProduct.ProId);
                ex = new FisException("CHK860", erpara);//此Product没有打印过,无需重印
                throw ex;
            }

            CurrentSession.AddValue(Session.SessionKeys.PrintLogName, curProduct.Customer + "SNO");
            CurrentSession.AddValue(Session.SessionKeys.PrintLogBegNo, curProduct.ProId);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogEndNo, curProduct.ProId);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogDescr, curProduct.CUSTSN);

            return base.DoExecute(executionContext);
        }
Example #17
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {            
     IDeliveryRepository DeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
     string type = (string)CurrentSession.GetValue("Doc_type");
     IList<VShipmentPakComnInfo> comnList = (IList<VShipmentPakComnInfo>)CurrentSession.GetValue("ComnList");
     //ITC-1360-1089 "Pack List-Addition"->"Pack List- Addition"
     if (type == "Pack List- Addition" || type == "ALL")
     {
         IList<string> tList = new List<string>();
         foreach (VShipmentPakComnInfo temp in comnList)
         {
             tList.Add(temp.internalID);
         }
         string dn = (string)CurrentSession.GetValue(Session.SessionKeys.DeliveryNo);
         if (!DeliveryRepository.CheckExistPakPackkingData(tList))
         {
             FisException ex;
             List<string> erpara = new List<string>();
             erpara.Add(dn);
             ex = new FisException("CHK821", erpara);
             throw ex;
         }
     }
     return base.DoExecute(executionContext);
 }
Example #18
0
 /// <summary>
 /// 根据type,defect删除一条数据
 /// </summary>
 /// <param name="type"></param>
 /// <param name="defect"></param>
 public void DeleteDefectCode(string type, string defect)
 {
     try
     {
         IDefectRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository>();
         int count = itemRepository.CheckExistsRecord(defect);
         if (count <= 0)
         {
             //已经不存在具有相同的defectCode记录
             List<string> erpara = new List<string>();
             FisException ex;
             ex = new FisException("DMT119", erpara);
             throw ex;
         }
         else
         {
             IUnitOfWork unitWork = new UnitOfWork();
             Defect defectInfo = itemRepository.Find(defect);
             itemRepository.Remove(defectInfo, unitWork);
             unitWork.Commit();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #19
0
        /// <summary>
        /// check label是否需要reprint
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            FisException ex;
            List<string> erpara = new List<string>();
            
            var repository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            IProduct curProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);

            IModelRepository modelRep = RepositoryFactory.GetInstance().GetRepository<IModelRepository, Model>();
            Model curModel = modelRep.Find(curProduct.Model);

            string stage = curModel.GetAttribute("STAG");
            if (stage == "S")
            {
                erpara.Add(this.Key);
                ex = new FisException("CHK865", erpara);//此Product设置为在Master Label Print中打印Customer SN,打印请求无效,请Check
                throw ex;
            }
            else if (stage == "T")
            {   //如果STAG=T 检查 Master Label 是否打印(查找WC=59的记录)
                IList<ProductLog> logList = repository.GetProductLogs(curProduct.ProId, "59");
                if (logList.Count == 0)
                {
                    erpara.Add(this.Key);
                    ex = new FisException("CHK866", erpara);//机器需要贴附Master Label,请先去打印Master Label
                    throw ex;
                }
            }

            return base.DoExecute(executionContext);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
           // IProduct currentProduct = null;
            RepairDefect defect = null;
            string ProductID = "";
            IProduct CurrentProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            defect = (RepairDefect)CurrentSession.GetValue(Session.SessionKeys.CurrentRepairdefect);
            if (defect == null)
            {
                List<string> errpara = new List<string>();

                errpara.Add("CurrentRepairdefect");
                FisException e = new FisException("CHK194", errpara);
                e.stopWF = this.IsStopWF;
                throw e;
            }
            // 0001494 用旧LCM CT 查询Product.CUSTSN,如果有值,才需要把新的LCM 更新到CUSTSN 栏位。
            if (productRepository.GetProductByIdOrSn(defect.OldPartSno) != null)
            {
                if (CurrentProduct == null)
                {
                    List<string> errpara = new List<string>();

                    errpara.Add(ProductID);
                    FisException e = new FisException("SFC002", errpara);
                    e.stopWF = this.IsStopWF;
                    throw e;
                }
                CurrentProduct.CUSTSN = defect.NewPartSno;

                productRepository.Update(CurrentProduct, CurrentSession.UnitOfWork);
            }
            return base.DoExecute(executionContext);
        }
Example #21
0
        /// <summary>
        /// check CUST SN是否为空或未产生
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            FisException ex;
            List<string> erpara = new List<string>();

            /*
            bool printFlag = false;
            var repository = RepositoryFactory.GetInstance().GetRepository<IPrintLogRepository, PrintLog>();
            IProduct product =(IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
          
            string name = product.Customer + "SNO";
            repository.GetProductLogs(currentProduct.ProId, "PKOK");
            printFlag = repository.CheckExistPrintLogByLabelNameAndDescr(name, product.ProId);
            */
            var repository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            Product curProduct = (Product)CurrentSession.GetValue(Session.SessionKeys.Product);
            IList<ProductLog> logList = repository.GetProductLogs(curProduct.ProId, this.Station);
            
            if (logList.Count == 0)
            {
                erpara.Add(curProduct.ProId);
                ex = new FisException("CHK860", erpara);//此Product没有打印过,无需重印
                throw ex;
            }
            CurrentSession.AddValue(Session.SessionKeys.PrintLogName, curProduct.Customer + "SNO");
            CurrentSession.AddValue(Session.SessionKeys.PrintLogBegNo, curProduct.CUSTSN);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogEndNo, curProduct.CUSTSN);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogDescr, curProduct.ProId);

            return base.DoExecute(executionContext);
        }
Example #22
0
 public bool CheckModel(string model, string customer)
 {
     FisException ex;
     List<string> erpara = new List<string>();
     try
     {
         logger.Debug("(OfflineLcdCtPrint)CheckModel start, model:" + model + " , customer=" + customer);
         IModelRepository modelRepository = RepositoryFactory.GetInstance().GetRepository<IModelRepository>();
         if (!modelRepository.CheckExistModel(customer, model))
         {
             erpara.Add(model);
             ex = new FisException("CHK928", erpara); // Model:%1不存在
             throw ex;
         }
         return true;
     }
     catch (FisException e)
     {
         throw e;
     }
     catch (Exception e)
     {
         throw new SystemException(e.Message);
     }
     finally
     {
         logger.Debug("(OfflineLcdCtPrint)CheckModel end, model:" + model + " , customer=" + customer);
     }
 }
Example #23
0
        /// <summary>
        /// check label是否需要reprint
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            FisException ex;
            List<string> erpara = new List<string>();
            
            var repository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            IProduct product =(IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            string curLine = (string)CurrentSession.GetValue(Session.SessionKeys.LineCode);
            
            IList<ProductLog> logList = repository.GetProductLogs("8D", 1, curLine);

            bool findflag = false;
            foreach (ProductLog node in logList)
            {
                if (node.ProductID == product.ProId)
                {
                    findflag = true;
                    break;
                }
            }

            if (!findflag)
            {
                erpara.Add(product.ProId);
                ex = new FisException("CHK860", erpara);//此Product没有打印过,无需重印
                throw ex;
            }

            CurrentSession.AddValue(Session.SessionKeys.PrintLogName, product.ProId);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogBegNo, product.CUSTSN);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogEndNo, product.CUSTSN);
            CurrentSession.AddValue(Session.SessionKeys.PrintLogDescr, product.ProId);
            return base.DoExecute(executionContext);
        }
Example #24
0
 public int AddLightStationItem(IMES.DataModel.LightStDef def)
 {
     int id=0;
     try 
     {
         IList<FaPaLightstInfo> infLst=itemRepository.CheckFaPaLightStationExist(def.iecpn, def.family, def.sation);
         if (infLst.Count>0)
         {
             List<string> param = new List<string>();
             FisException fe = new FisException("DMT133", param);
             throw fe;
         }
         else 
         {
             FaPaLightstInfo info = new FaPaLightstInfo();
             PO2VO(def, info);
             itemRepository.AddFaPaLightStationItem(info);
             id = info.id;
         }
     }
     catch(Exception)
     {
         throw;
     }
     return id;
 }
        public void AddITCNDCheckSetting(IMES.DataModel.ITCNDCheckSettingDef item)
        {
            try
            {
                //ITC-1361-0159
                ITCNDCheckSettingDef cond = new ITCNDCheckSettingDef();
                cond.line = item.line;
                cond.station = item.station;
                cond.checkItem = item.checkItem;

                IList<ITCNDCheckSettingDef> dataLst = new List<ITCNDCheckSettingDef>();
                dataLst = productRepository.GetExistITCNDCheckSetting(cond);
                if (dataLst != null && dataLst.Count > 0)
                {
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT151", erpara);
                    throw ex;
                }
                productRepository.AddITCNDCheckSetting(item);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #26
0
        public void UpdateForwarder(ForwarderInfo item)
        {
            try
            {
                IPalletRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IPalletRepository>();

                DataTable exists = itemRepository.GetExistForwarder(item);
                if (exists != null && exists.Rows.Count > 0)
                {
                    if (exists.Rows[0][0].ToString() != item.Id.ToString())
                    {
                        //!!!need change
                        //已经存在具有相同Date、Forwarder、MAWB、Driver和Truck ID的Forwarder记录
                        List<string> erpara = new List<string>();
                        FisException ex;
                        ex = new FisException("DMT055", erpara);
                        throw ex;
                    }
                }                
                itemRepository.UpdateForwarder(item);
            }
            catch (Exception)
            {
                throw;
            }

        }
Example #27
0
        /// <summary>
        /// delete repair of MB,and save MB
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="mbsno">mbsno</param>
        public void OnMBSNSave(string line, string editor, string station, string customer, string mbsno)
        {
            string keyStr = "";
            try
            {
                
                string sessionKey = mbsno;
                keyStr = sessionKey;
                Session currentSession = SessionManager.GetInstance.GetSession(sessionKey, SessionType);
                if (null == currentSession)
                {
                    currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                }
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "FAMBReturn.xoml", "fambreturn.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.MBSN, mbsno);
                currentSession.AddValue(Session.SessionKeys.IsComplete, false); 
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Example #28
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IPartRepository partRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
            var currentProduct = CurrentSession.GetValue(Session.SessionKeys.Product) as IProduct;
            if (currentProduct == null)
            {
                var ex1 = new FisException("SFC002", new string[] { "" });
                throw ex1;
            }
             IList<string> lstUrl;
             IList<string> lstUser;
             IList<string> lstPwd;
             IList<string> lstreturncode;
            if (ActivityCommonImpl.Instance.CheckModelByProcReg(currentProduct.Model, "ThinClient"))
            {
                 lstUrl = partRepository.GetValueFromSysSettingByName("TCRETUENOA3KEYURL");
                 lstUser = partRepository.GetValueFromSysSettingByName("TCRETUENOA3KEYUser");
                 lstPwd = partRepository.GetValueFromSysSettingByName("TCRETUENOA3KEYPassword");
                 lstreturncode = partRepository.GetValueFromSysSettingByName("TCRETUENOA3KEYCODE");
            }
            else
            {
               lstUrl = partRepository.GetValueFromSysSettingByName("RETUENOA3KEYURL");
               lstUser = partRepository.GetValueFromSysSettingByName("RETUENOA3KEYUser");
               lstPwd = partRepository.GetValueFromSysSettingByName("RETUENOA3KEYPassword");
               lstreturncode = partRepository.GetValueFromSysSettingByName("RETUENOA3KEYCODE");
            }
           string  url = lstUrl.Count == 0 ? "" : lstUrl[0];
           string user = lstUser.Count == 0 ? "" : lstUser[0];
           string password = lstPwd.Count == 0 ? "" : lstPwd[0];
           string returncode = lstreturncode.Count == 0 ? "" : lstreturncode[0];
           if ("" == url || "" == user || "" == password || ""==returncode)
            { throw new FisException("Wrong ReturnOA3Key setting"); }
           IList<IMES.FisObject.FA.Product.ProductInfo> pis = currentProduct.ProductInfoes;
           bool haswin8key = false;
           if (pis != null)
           {
               foreach (IMES.FisObject.FA.Product.ProductInfo pi in pis)
               {
                   if ("COA".Equals(pi.InfoType))
                   {
                       haswin8key = true;
                   }
               }
           }

           if (currentProduct.CUSTSN != "" && haswin8key)
           {
               string fkimessage = "";
               if (!CALL_FKIWEBSERVICE(url, user, password, currentProduct.CUSTSN, returncode, DateTime.Now.ToString(), out fkimessage))
               {
                   throw new FisException(currentProduct.CUSTSN+"  ReturnOA3Key Error,FKI Return Message:" + fkimessage);
               }
           }

            return base.DoExecute(executionContext);

        }
Example #29
0
        public string AddPAKitLoc(IMES.DataModel.PAKitLocDef item)
        {
            string id = "";
            if(item!=null)
            {

                try 
                {
                    FisException ex;
                    IList<PAKitLoc> pakRes=itemRepository.GetPAKitlocByPdLine(item.pdLine);
                    if(pakRes!=null)
                    {
                        foreach(PAKitLoc loc in pakRes)
                        {
                            if(loc.partNo.Trim().ToLower()==item.partNo.Trim().ToLower())
                            {
                                List<string> param = new List<string>();
                                ex = new FisException("DMT080", param);
                                throw ex;
                            }
                        }
                    }
                    PAKitLoc addLoc = new PAKitLoc();
                    addLoc.location = item.location;
                    addLoc.partNo = item.partNo;
                    addLoc.pdLine = item.pdLine;
                    addLoc.station = item.station;
                    addLoc.descr = item.Descr;
                    addLoc.editor = item.editor;
                    addLoc.udt = DateTime.Now;
                    addLoc.cdt = DateTime.Now;
                    IUnitOfWork uo = new UnitOfWork();
                    itemRepository.AddPAKitLocDefered(uo, addLoc);
                    IList<PAKitLoc> pakLst=itemRepository.GetPAKitlocByStation(item.station);
                    foreach(PAKitLoc loc in pakLst){
                        if (loc.location != item.location)
                        {
                            loc.location = item.location;
                            itemRepository.UpdatePAKitLocDefered(uo, loc);
                        }
                        
                    }
                    //itemRepository.AddPAKitLoc(addLoc);
                    uo.Commit();
                    id = addLoc.id.ToString();
                }
                catch(Exception ee)
                {
                    logger.Error(ee.Message);
                    throw;
                }

            }
            return id;
            
        }
Example #30
0
        public String GetUnitWeightByModel(string model)
        {
            //检查合法model
            //看取得的数据是否有数据
            String result = "";
            try
            {

                IModelRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IModelRepository>();

                Model modelItem=itemRepository.Find(model);

                if (modelItem == null)
                {
                    //This model does not exist
                    //不存在这个Model
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT148", erpara);
                    throw ex;

                }

                IModelWeightRepository itemRepositoryModelWeight = RepositoryFactory.GetInstance().GetRepository<IModelWeightRepository>();

                DataTable modelWeight = itemRepositoryModelWeight.GetModelWeightItem(model);
                if (modelWeight == null || modelWeight.Rows.Count == 0)
                {
                    //This Model, there is no standard weight, please go to the weighing.
                    //该Model尚无标准重量,请先去称重。
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT149", erpara);
                    throw ex;
                }

                result = modelWeight.Rows[0][1].ToString();

                if (result == "")
                {
                    //该Model尚无标准重量,请先去称重。
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT149", erpara);
                    throw ex;
                }
                
            }
            catch (Exception)
            {
                throw;
            }

            return result;

        }