예제 #1
0
        /// <summary>
        /// 设置公众号信息
        /// </summary>
        /// <param name="mygzhState">传页url传进来的state</param>
        /// <param name="mygzh"></param>
        /// <param name="mylibIds"></param>
        public int SetGzhInfo(string state,
                              out string strError)
        {
            int nRet = 0;

            strError = "";

            // 如果传进来的state为空,则设为:我爱图书馆
            if (string.IsNullOrEmpty(state) == true)
            {
                state = "ilovelibrary";
                //dp2WeiXinService.Instance.WriteDebug2("公众号state参数为空,设为ilovelibrary。");
            }

            // 根据state参数,获取公众号配置信息和图书馆配置
            nRet = dp2WeiXinService.Instance.GetGzhAndLibs(state,
                                                           out GzhCfg gzh1,
                                                           out List <string> libList1,
                                                           out strError);
            if (nRet == -1)
            {
                strError = "GetGzhAndLibs()出错:" + strError;
                return(-1);
            }

            if (gzh1 == null)
            {
                strError = "异常,未得到公众号配置信息";
                return(-1);
            }
            // 设到成员变量
            this.gzhState = state;
            this.gzh      = gzh1;
            this.libIds   = libList1;

            //dp2WeiXinService.Instance.WriteDebug2("SetGzhInfo(),state=[" + state + "],mylibIds.count=[" + libList1.Count + "]");

            return(0);
        }
예제 #2
0
 public void SetInfo(string mygzhState, GzhCfg mygzh, List <string> mylibIds)
 {
     this.gzhState = mygzhState;
     this.gzh      = mygzh;
     this.libIds   = mylibIds;
 }