示例#1
0
        /// <summary>
        /// 获取最新的安装包信息(通用方案
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, Model.UpdateInfo> GetNewList()
        {
            var updateList = new DAL.UpdateInfo().GetNewList();

            if (updateList != null)
            {
                Dictionary <string, Model.UpdateInfo> result = new Dictionary <string, Model.UpdateInfo>();
                foreach (var eachItem in updateList)
                {
                    string keyName = string.Format("{0}_{1}_{2}", eachItem.SchemeId, eachItem.PackName, eachItem.ChannelNo);
                    if (result.ContainsKey(keyName))
                    {
                        var oldItem = result[keyName];
                        if (oldItem.VerCode < eachItem.VerCode)
                        {
                            result[keyName] = eachItem;
                        }
                    }
                    else
                    {
                        result.Add(keyName, eachItem);
                    }
                }
                return(result);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// 获取所有更新信息
        /// </summary>
        /// <param name="appid"></param>
        /// <returns></returns>
        public List <Model.UpdateInfo> GetAll(int appid, int schemeId)
        {
            var result = new DAL.UpdateInfo().GetAll(appid, schemeId);

            if (result != null)
            {
                var appList = new AppInfo().GetDictAll();
                if (appList != null)
                {
                    foreach (var eachItem in result)
                    {
                        if (appList.ContainsKey(eachItem.AppId))
                        {
                            eachItem.AppName = appList[eachItem.AppId].AppName;
                        }
                    }
                }
            }
            return(result);
        }