Example #1
0
        private static WCacheValue <string> Product;//服务器端获取产品名信息


        #region 重写 OnInit
        protected override void OnPreInit(EventArgs e)
        {
            //服务器端产品信息
            Product = WCache.CreateInProcCache <string>(() =>
            {
                ESBData d = ESB.UP.WinLoginService.Invoke("GetProduct");
                return(Ajax.DealAndGetValue(d) as string);
            }, DateTime.Now.AddDays(1));

            base.OnPreInit(e);
        }
Example #2
0
        /// <summary>
        /// 根据服务器名称获取帐套信息
        /// </summary>
        /// <param name="servername">数据库服务名称</param>
        /// <returns></returns>
        private DataTable GetAccInfo(string servername)
        {
            string result      = null;
            int    serverindex = 0;

            if (!string.IsNullOrEmpty(servername))
            {
                serverindex = this.GetServerIndex(servername);//数据库服务器名在database.xml文件中的索引
            }
            //获取公共链接串
            string _publicConnectStr = ESB.UP.WinLoginService.InvokeWithMessage("GetMainConnStringElement", 1, serverindex, result).Value as string;
            //获取帐套信息
            var d = ESB.UP.WinLoginService.Invoke("GetAccInfo", _publicConnectStr);

            return(Ajax.DealAndGetValue(d) as DataTable);
        }