Example #1
0
        /// <summary>
        /// 获取服务组件
        /// </summary>
        /// <returns>返回组件接口</returns>
        public static T GetServerModule <T>()
        {
            string name = typeof(T).ToString();

            m_hashTable = new Hashtable();

            if (typeof(T) == typeof(IBasicGoodsServer))
            {
                IBasicGoodsServer serverModule = new BasicGoodsServer();
                m_hashTable.Add(name, serverModule);
            }
            else if (typeof(T) == typeof(IDepotTypeForPersonnel))
            {
                IDepotTypeForPersonnel serverModule = new DepotTypeForPersonnel();
                m_hashTable.Add(name, serverModule);
            }
            else if (typeof(T) == typeof(IPersonnelInfoServer))
            {
                IPersonnelInfoServer serverModule = new PersonnelInfoServer();
                m_hashTable.Add(name, serverModule);
            }

            if (m_hashTable.ContainsKey(name))
            {
                return((T)m_hashTable[name]);
            }

            return(default(T));
        }
Example #2
0
        /// <summary>
        /// 判断是否属于自制件
        /// </summary>
        /// <param name="goodsID">物品ID</param>
        /// <returns>True 是, False 否</returns>
        public bool IsInHomemadePartInfo(int goodsID)
        {
            BasicGoodsServer goodsServer = new BasicGoodsServer();

            F_GoodsAttributeRecord record = goodsServer.GetGoodsAttirbuteRecord(goodsID, 12);

            if (record != null && record.AttributeValue == "True")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }