Esempio n. 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="session"></param>
        /// <param name="product"></param>
        /// <param name="mb"></param>
        /// <param name="delivery"></param>
        /// <param name="part"></param>
        /// <param name="name"></param>
        /// <param name="spliter"></param>
        /// <returns></returns>
        public static string GetValue(Session session, 
                                                    IProduct product, 
                                                    IMB mb, 
                                                    Delivery delivery, 
                                                    IPart part,
                                                    string name, char spliter)
        {
            int index = name.IndexOf(spliter);
            if (index < 1)
            {
                throw new Exception("wrong method name : " + name);
            }

            string objName = name.Substring(0, index).ToUpper();
            string objMethod = name.Substring(index + 1).Trim();

            if (objName == "PRODUCTINFO")
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "ProductInfo" });
                }
                return product.ProductInfoes
                                            .Where(x => x.InfoType == objMethod)
                                            .Select(y => y.InfoValue).FirstOrDefault();
            }

            if (objName == "MODELINFO")
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                return product.ModelObj.Attributes
                                            .Where(x => x.Name == objMethod)
                                            .Select(y => y.Value).FirstOrDefault();
            }

            if (objName == "FAMILYINFO")
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                string family = product.Family;
               
                IList<FamilyInfoDef> familyInfoList = familyRep.GetExistFamilyInfo(new FamilyInfoDef { family = family, name = objMethod });

                if (familyInfoList == null || familyInfoList.Count == 0)
                {
                    throw new FisException("CHK1036", new List<string> { family, objMethod });
                }

                return familyInfoList[0].value;
            }

            if (objName == "PRODUCT")
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                string value = (string)product.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value;
            }

            if (objName == "PCB")
            {
                if (mb == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "PCB" });
                }
                string value = (string)mb.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value;
            }

            if (objName == "PCBINFO")
            {
                if (mb == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "PCB" });
                }

                return mb.MBInfos
                               .Where(x => x.InfoType == objMethod)
                               .Select(y => y.InfoValue).FirstOrDefault();
            }

            if (objName == "DELIVERY")
            {
                if (delivery == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                string value = (string)delivery.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value;
            }

            if (objName == "DELIVERYINFO")
            {
                if (delivery == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                return delivery.DeliveryInfoes
                              .Where(x => x.InfoType == objMethod)
                              .Select(y => y.InfoValue).FirstOrDefault();
            }


            if (objName == "PART")
            {
                if (part == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Part" });
                }
                string value = (string)part.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value;
            }

            if (objName == "PARTINFO")
            {
                if (part == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Part" });
                }
                return part.Attributes
                             .Where(x => x.InfoType == objMethod)
                             .Select(y => y.InfoValue).FirstOrDefault();
            }

            throw new Exception("not support resolve name:" + name);
        }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>       
        /// <param name="product"></param>
        /// <param name="mb"></param>
        /// <param name="delivery"></param>
        /// <param name="part"></param>
        /// <param name="name"></param>
        /// <param name="spliter"></param>
        /// <returns></returns>
        public static string GetValue(IProduct product, IMB mb, Delivery delivery, Part part,
                                                    string name, char spliter)
        {
            int index = name.IndexOf(spliter);
            if (index < 1)
            {
                throw new Exception("wrong method name : " + name);
            }

            string objName = name.Substring(0, index).ToUpper();
            string objMethod = name.Substring(index + 1).Trim();

            if (objName == GlobalConstName.ResolveValue.PRODUCTINFO)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                if (product.ProductInfoes == null || 
                    !product.ProductInfoes.Any(x => x.InfoType == objMethod))
                {
                     throw new FisException("CHK1036", new List<string> { product.ProId, name });
                }
                return product.ProductInfoes
                                            .Where(x => x.InfoType == objMethod)
                                            .Select(y => y.InfoValue).FirstOrDefault().Trim();
            }


            if (objName == GlobalConstName.ResolveValue.PRODUCTATTR)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                if (product.ProductAttributes == null ||
                    !product.ProductAttributes.Any(x => x.AttributeName == objMethod))
                {
                    throw new FisException("CHK1036", new List<string> { product.ProId, name });
                }
                return product.ProductAttributes
                                            .Where(x => x.AttributeName == objMethod)
                                            .Select(y => y.AttributeValue).FirstOrDefault().Trim();
            }

            if (objName == GlobalConstName.ResolveValue.MODELINFO)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }

                if (product.ModelObj ==null||
                    product.ModelObj.Attributes == null ||
                    !product.ModelObj.Attributes.Any(x => x.Name == objMethod))
                {
                     throw new FisException("CHK1036", new List<string> { product.Model, name });
                }

                return product.ModelObj.Attributes
                                            .Where(x => x.Name == objMethod)
                                            .Select(y => y.Value).FirstOrDefault().Trim();
            }

            if (objName == GlobalConstName.ResolveValue.FAMILYINFO)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                string family = product.Family;
                //IFamilyRepository familyRep = RepositoryFactory.GetInstance().GetRepository<IFamilyRepository>();
                IList<FamilyInfoDef> familyInfoList = familyRep.GetExistFamilyInfo(new FamilyInfoDef { family = family, name = objMethod });

                if (familyInfoList == null || familyInfoList.Count == 0)
                {
                    throw new FisException("CHK1036", new List<string> { family, name });
                }

                return familyInfoList[0].value.Trim();
            }

            if (objName == GlobalConstName.ResolveValue.PRODUCT)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                string value = (string)product.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.Trim();
            }

            if (objName == GlobalConstName.ResolveValue.PCB)
            {
                if (mb == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "PCB" });
                }
                string value = (string)mb.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.Trim();
            }

            if (objName == GlobalConstName.ResolveValue.PCBINFO)
            {
                if (mb == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "PCB" });
                }

                if (mb.MBInfos==null || 
                    !mb.MBInfos.Any(x => x.InfoType == objMethod))
                {
                    throw new FisException("CHK1036", new List<string> { mb.Sn, name });
                }

                return mb.MBInfos
                               .Where(x => x.InfoType == objMethod)
                               .Select(y => y.InfoValue).FirstOrDefault().Trim();
            }

            if (objName == GlobalConstName.ResolveValue.DELIVERY)
            {
                if (delivery == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                string value = (string)delivery.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.Trim();
            }

            if (objName == GlobalConstName.ResolveValue.DELIVERYINFO)
            {
                if (delivery == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }

                if (delivery.DeliveryInfoes==null||
                    !delivery.DeliveryInfoes.Any(x => x.InfoType == objMethod))
                {
                    throw new FisException("CHK1036", new List<string> { delivery.DeliveryNo, name });
                }

                return delivery.DeliveryInfoes
                              .Where(x => x.InfoType == objMethod)
                              .Select(y => y.InfoValue).FirstOrDefault().Trim();
            }


            if (objName == GlobalConstName.ResolveValue.PART)
            {
                if (part == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Part" });
                }
                string value = (string)part.GetProperty(objMethod);
                if (string.IsNullOrEmpty(value))
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.Trim();
            }

            if (objName == GlobalConstName.ResolveValue.PCBINFO)
            {
                if (part == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Part" });
                }

                if (part.Attributes==null ||
                    !part.Attributes.Any(x => x.InfoType == objMethod))
                {
                    throw new FisException("CHK1036", new List<string> { part.PN, name });
                }

                return part.Attributes
                             .Where(x => x.InfoType == objMethod)
                             .Select(y => y.InfoValue).FirstOrDefault().Trim();
            }

            throw new Exception("not support resolve name:" + name);
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="session"></param>
        /// <param name="product"></param>
        /// <param name="mb"></param>
        /// <param name="delivery"></param>
        /// <param name="part"></param>
        /// <param name="name"></param>
        /// <param name="spliter"></param>
        /// <returns></returns>
        public static string GetValue(Session session, 
                                                    IProduct product, 
                                                    IMB mb, 
                                                    Delivery delivery, 
                                                    IPart part,
                                                    string name, char spliter)
        {
            int index = name.IndexOf(spliter);
            if (index < 1)
            {
                throw new Exception("wrong method name : " + name);
            }

            string objName = name.Substring(0, index).ToUpper();
            string objMethod = name.Substring(index + 1).Trim();

            if (objName == GlobalConstName.ResolveValue.PRODUCTINFO)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                return product.ProductInfoes
                                            .Where(x => x.InfoType == objMethod)
                                            .Select(y => y.InfoValue).FirstOrDefault();
            }
            if (objName == GlobalConstName.ResolveValue.PRODUCTATTR)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                if (product.ProductAttributes == null ||
                    !product.ProductAttributes.Any(x => x.AttributeName == objMethod))
                {
                    throw new FisException("CHK1036", new List<string> { product.ProId, name });
                }
                return product.ProductAttributes
                                            .Where(x => x.AttributeName == objMethod)
                                            .Select(y => y.AttributeValue).FirstOrDefault().Trim();
            }

            if (objName == GlobalConstName.ResolveValue.MODEL)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });                   
                }

                if (product.ModelObj == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product.ModelObj" });
                }

                object value = product.ModelObj.GetProperty(objMethod);
                if (value == null)
                {
                    return null;
                }
                return value.ToString().Trim();

            }

            if (objName == GlobalConstName.ResolveValue.MODELINFO)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }

                if (product.ModelObj == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product.ModelObj" });
                }

                return product.ModelObj.Attributes
                                            .Where(x => x.Name == objMethod)
                                            .Select(y => y.Value).FirstOrDefault();
            }

            if (objName == GlobalConstName.ResolveValue.FAMILYINFO)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                string family = product.Family;
                //IFamilyRepository familyRep = RepositoryFactory.GetInstance().GetRepository<IFamilyRepository>();
                IList<FamilyInfoDef> familyInfoList = familyRep.GetExistFamilyInfo(new FamilyInfoDef { family = family, name = objMethod });

                if (familyInfoList == null || familyInfoList.Count == 0)
                {
                    throw new FisException("CHK1036", new List<string> { family, objMethod });
                }

                return familyInfoList[0].value;
            }

            if (objName == GlobalConstName.ResolveValue.PRODUCT)
            {
                if (product == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product" });
                }
                object value = product.GetProperty(objMethod);
                if (value==null)
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.ToString();
            }

            #region disable for ICI HTC case
            //if (objName == GlobalConstName.ResolveValue.IMGOSVER)
            //{
            //    if (product == null)
            //    {
            //       throw new FisException("CQCHK0006", new List<string> { "Product" });                   
            //    }

            //    if (product.ModelObj == null ||
            //        string.IsNullOrEmpty(product.ModelObj.OSCode) ||
            //        product.ModelObj.LastEffectiveOSVer == null)
            //    {
            //        throw new FisException("CQCHK0006", new List<string> { "No setup ImgOSVer" });
            //    }

            //    object value = product.ModelObj.LastEffectiveOSVer.GetField(objMethod);
            //    if (value == null)
            //    {
            //        throw new FisException("not exists field name:" + name);
            //    }

            //    return value.ToString().Trim();
            //} 
            #endregion

            if (objName == GlobalConstName.ResolveValue.PCB)
            {
                if (mb == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "PCB" });
                }
                object value = mb.GetProperty(objMethod);
                if (value == null)
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.ToString();
            }

            if (objName == GlobalConstName.ResolveValue.PCBINFO)
            {
                if (mb == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "PCB" });
                }

                return mb.MBInfos
                               .Where(x => x.InfoType == objMethod)
                               .Select(y => y.InfoValue).FirstOrDefault();
            }

            if (objName == GlobalConstName.ResolveValue.DELIVERY)
            {
                if (delivery == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                object value = delivery.GetProperty(objMethod);
                if (value == null)
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.ToString();
            }

            if (objName == GlobalConstName.ResolveValue.DELIVERYINFO)
            {
                if (delivery == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                return delivery.DeliveryInfoes
                              .Where(x => x.InfoType == objMethod)
                              .Select(y => y.InfoValue).FirstOrDefault();
            }


            if (objName == GlobalConstName.ResolveValue.PART)
            {
                if (part == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                object value = part.GetProperty(objMethod);
                if (value==null)
                {
                    throw new FisException("not exists property name:" + name);
                }
                return value.ToString();
            }

            if (objName == GlobalConstName.ResolveValue.PARTINFO)
            {
                if (part == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                }
                return part.Attributes
                             .Where(x => x.InfoType == objMethod)
                             .Select(y => y.InfoValue).FirstOrDefault();
            }

            if (objName == GlobalConstName.ResolveValue.SESSION)
            {
                if (session == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Session" });                    
                }
                object value = session.GetValue(objMethod);
                if (value == null)
                {
                    throw new FisException("not exists session key name:" + name);
                }
                return value.ToString().Trim();
            }
            if (objName == GlobalConstName.ResolveValue.DATETIME)
            {
                DateTime now = DateTime.Now;
                return now.ToString(objMethod);
            }

            if (objName == GlobalConstName.ResolveValue.CONSTANT)
            {
                return objMethod;
            } 
            throw new Exception("not support resolve name:" + name);
        }
Esempio n. 4
0
        private static string getValueInner(Session session, IProduct product, IMB mb, Delivery delivery, IPart part,
                                                            string name, char spliter, bool isThrowError)
        {
            int index = name.IndexOf(spliter);
            if (index < 1)
            {
                throw new Exception("wrong method name : " + name);
            }

            string objName = name.Substring(0, index);
            string objMethod = name.Substring(index + 1).Trim();

            if (string.Compare(objName, GlobalConstName.ResolveValue.PRODUCTINFO, true) == 0)
            {
                if (product == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product" });
                    }
                    else
                    {
                        return null;
                    }
                }
                if (product.ProductInfoes == null ||
                   !product.ProductInfoes.Any(x => x.InfoType == objMethod))
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { product.ProId, name });
                    }
                    else
                    {
                        return null;
                    }
                }

                return product.ProductInfoes
                                            .Where(x => x.InfoType == objMethod)
                                            .Select(y => y.InfoValue).FirstOrDefault();
            }
            if (string.Compare(objName, GlobalConstName.ResolveValue.PRODUCTATTR, true) == 0)
            {
                if (product == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product" });
                    }
                    else
                    {
                        return null;
                    }
                }
                if (product.ProductAttributes == null ||
                    !product.ProductAttributes.Any(x => x.AttributeName == objMethod))
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { product.ProId, name });
                    }
                    else
                    {
                        return null;
                    }
                }
                return product.ProductAttributes
                                            .Where(x => x.AttributeName == objMethod)
                                            .Select(y => y.AttributeValue).FirstOrDefault().Trim();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.MODEL,true) == 0)
            {
                if (product == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product" });
                    }
                    else
                    {
                        return null;
                    }
                }

                if (product.ModelObj == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product.ModelObj" });
                    }
                    else
                    {
                        return null;
                    }                    
                }

                object value = product.ModelObj.GetProperty(objMethod);
                if (value == null)
                {
                    var model = product.ModelObj;
                    value = model.GetAttribute(objMethod);
                    if (value == null)
                    {
                        if (isThrowError)
                        {
                            throw new FisException("CHK1036", new List<string> { product.Model, name });
                        }
                        else
                        {
                            return null;
                        }
                    }
                }
                return value.ToString();

            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.MODELINFO, true) == 0)
            {
                if (product == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product" });
                    }
                    else
                    {
                        return null;
                    }
                }

                var model = product.ModelObj;
                if (model == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Product.ModelObj" });
                }

                string value = model.GetAttribute(objMethod);
                if (value == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { product.Model, name });
                    }
                    else
                    {
                        return null;
                    }
                }
                return value;
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.FAMILYINFO, true) == 0 ||
                string.Compare(objMethod, GlobalConstName.ResolveValue.FAMILY, true) == 0)
            {
                if (product == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product" });
                    }
                    else
                    {
                        return null;
                    }
                }

                var family = product.FamilyObj;
                if (family == null)
                {                   
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Family" });
                    }
                    else
                    {
                        return null;
                    }
                }

                object value = family.GetProperty(objMethod);
                if (value == null)
                {
                    value = family.GetAttribute(objMethod);
                    if (value == null)
                    {
                        if (isThrowError)
                        {
                            throw new FisException("CHK1036", new List<string> { family.FamilyName, objMethod });
                        }
                        else
                        {
                            return null;
                        }
                    }
                }

                return value.ToString();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.PRODUCT, true) == 0)
            {
                if (product == null)
                {                   
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Product" });
                    }
                    else
                    {
                        return null;
                    }
                }
                object value = product.GetProperty(objMethod);
                if (value == null)
                {
                    value = product.GetAttribute(objMethod);
                    if (value == null)
                    {
                        if (isThrowError)
                        {
                            throw new FisException("not exists property name:" + name);
                        }
                        else
                        {
                            return null;
                        }
                    }
                }
                return value.ToString();
            }

            #region IMGOSVER for HTC
            //if (string.Compare(objName, GlobalConstName.ResolveValue.IMGOSVER, true) == 0)
            //{
            //    if (product == null)
            //    {                    
            //        if (isThrowError)
            //        {
            //            throw new FisException("CQCHK0006", new List<string> { "Product" });
            //        }
            //        else
            //        {
            //            return null;
            //        }
            //    }

            //    if (product.ModelObj == null ||
            //        string.IsNullOrEmpty(product.ModelObj.OSCode) ||
            //        product.ModelObj.LastEffectiveOSVer == null)
            //    {                    
            //        if (isThrowError)
            //        {
            //            throw new FisException("CQCHK0006", new List<string> { "No setup ImgOSVer" });
            //        }
            //        else
            //        {
            //            return null;
            //        }

            //    }

            //    object value = product.ModelObj.LastEffectiveOSVer.GetField(objMethod);
            //    if (value == null)
            //    {
            //        if (isThrowError)
            //        {
            //            throw new FisException("not exists field name:" + name);
            //        }
            //        else
            //        {
            //            return null;
            //        }
            //    }

            //    return value.ToString().Trim();
            //}
            #endregion

            if (string.Compare(objName, GlobalConstName.ResolveValue.PCB, true) == 0)
            {
                if (mb == null)
                {                    
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "PCB" });
                    }
                    else
                    {
                        return null;
                    }
                }
                object value = mb.GetProperty(objMethod);
                if (value == null)
                {
                    value = mb.GetAttribute(objMethod);
                    if (value == null)
                    {
                        if (isThrowError)
                        {
                            throw new FisException("not exists property name:" + name);
                        }
                        else
                        {
                            return null;
                        }
                    }
                }
                return value.ToString();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.PCBINFO, true) == 0)
            {
                if (mb == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "PCB" });
                    }
                    else
                    {
                        return null;
                    }
                }

                if (mb.MBInfos == null ||
                      !mb.MBInfos.Any(x => x.InfoType == objMethod))
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { mb.Sn, name });
                    }
                    else
                    {
                        return null;
                    }
                }
                return mb.MBInfos
                               .Where(x => x.InfoType == objMethod)
                               .Select(y => y.InfoValue).FirstOrDefault();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.PCBATTR, true) == 0)
            {
                if (mb == null)
                {                   
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "PCB" });
                    }
                    else
                    {
                        return null;
                    }
                }

                if (mb.PCBAttributes == null ||
                    !mb.PCBAttributes.Any(x => x.AttributeName == objMethod))
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { mb.Sn, name });
                    }
                    else
                    {
                        return null;
                    }
                }

                return mb.PCBAttributes
                               .Where(x => x.AttributeName == objMethod)
                               .Select(y => y.AttributeValue).FirstOrDefault().Trim();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.DELIVERY, true) == 0)
            {
                if (delivery == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                    }
                    else
                    {
                        return null;
                    }
                }
                object value = delivery.GetProperty(objMethod);
                if (value == null)
                {
                    value = delivery.GetExtendedProperty(objMethod);
                    if (value == null)
                    {
                        if (isThrowError)
                        {
                            throw new FisException("not exists property name:" + name);
                        }
                        else
                        {
                            return null;
                        }
                    }
                }
                return value.ToString();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.DELIVERYINFO, true) == 0)
            {
                if (delivery == null)
                {                    
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Delivery" });
                    }
                    else
                    {
                        return null;
                    }
                }

                if (delivery.DeliveryInfoes == null ||
                    !delivery.DeliveryInfoes.Any(x => x.InfoType == objMethod))
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { delivery.DeliveryNo, name });
                    }
                    else
                    {
                        return null;
                    }
                }

                return delivery.DeliveryInfoes
                              .Where(x => x.InfoType == objMethod)
                              .Select(y => y.InfoValue).FirstOrDefault();
            }


            if (string.Compare(objName, GlobalConstName.ResolveValue.PART, true) == 0)
            {
                if (part == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Part" });
                    }
                    else
                    {
                        return null;
                    }
                }
                object value = part.GetProperty(objMethod);
                if (value == null)
                {
                    value = part.GetAttribute(objMethod);
                    if (value == null)
                    {
                        if (isThrowError)
                        {
                            throw new FisException("not exists property name:" + name);
                        }
                        else
                        {
                            return null;
                        }
                    }
                }
                return value.ToString();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.PARTINFO, true) == 0)
            {
                if (part == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("CQCHK0006", new List<string> { "Part" });
                    }
                    else
                    {
                        return null;
                    }
                }

                if (part.Attributes == null ||
                  !part.Attributes.Any(x => x.InfoType == objMethod))
                {
                    if (isThrowError)
                    {
                        throw new FisException("CHK1036", new List<string> { part.PN, name });
                    }
                    else
                    {
                        return null;
                    }
                }

                return part.Attributes
                             .Where(x => x.InfoType == objMethod)
                             .Select(y => y.InfoValue).FirstOrDefault();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.SESSION, true) == 0)
            {
                if (session == null)
                {
                    throw new FisException("CQCHK0006", new List<string> { "Session" });
                }
                object value = session.GetValue(objMethod);
                if (value == null)
                {
                    if (isThrowError)
                    {
                        throw new FisException("not exists session key name:" + name);
                    }
                    else
                    {
                        return null;
                    }
                }
                return value.ToString().Trim();
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.DATETIME, true) == 0)
            {
                DateTime now = DateTime.Now;
                return now.ToString(objMethod);
            }

            if (string.Compare(objName, GlobalConstName.ResolveValue.CONSTANT, true) == 0)
            {
                return objMethod;
            }
            throw new Exception("not support resolve name:" + name);
        }