Esempio n. 1
0
        /// <summary>
        /// 登录中
        /// </summary>
        /// <param name="obj"></param>
        private void IsLogining(object obj)
        {
            IsLoginingEvent?.Invoke(true);//触发登录成功前事件

            #region 拉取个人信息
            var mine = HttpService.GetMine();//个人信息
            if (mine != null && mine.Success && mine.data != null)
            {
                LoginData = mine.data;
                if (cookies != null && LoginInfo != null && LoginData.currentCompany != null)
                {
                    //USeManager.Instance.Stop();
                    string clientid = LoginData.currentCompany.id + "_pc";
                    USeManager.Instance.Start(clientid, LoginInfo.username, HttpUtility.UrlEncode(cookies));
                }
            }
            #endregion

            #region 拉取合约行情列表 重新初始化
            InitializationData();
            #endregion

            #region 拉取黑白名单
            GetWhiteAndBlack();
            #endregion

            #region 拉取全部的等级和品牌信息
            var LevelBrand = HttpService.GetBaseLevelBrandInfo();
            if (LevelBrand != null && LevelBrand.Result != null)
            {
                LevelBrandDy.Clear();
                foreach (var v in LevelBrand.Result)
                {
                    if (!LevelBrandDy.ContainsKey(v.id))
                    {
                        LevelBrandDy.Add(v.id, v);
                    }
                    else
                    {
                        LevelBrandDy[v.id] = v;
                    }
                }
            }
            #endregion

            #region 拉取成交列表
            var Tradedlisting = HttpService.GetTradedlisting();
            if (Tradedlisting != null && Tradedlisting.data != null)
            {
                TradedList = Tradedlisting.data;
            }
            #endregion

            isLogin = true;
            IsLoginEvent?.Invoke(true);//触发登录成功事件
        }
Esempio n. 2
0
        /// <summary>
        /// 注销
        /// </summary>
        public void LoginOff()
        {
            if (isLogin)
            {
                if (DataManager.Instance.Cookies != null)
                {
                    HttpService.LoginOff();

                    LoginData = null;
                    Account   = null;
                    Password  = null;
                    cookies   = null;
                    LevelBrandDy.Clear();
                    Delist = null;
                    wareHouses.Clear();
                    WhiteEnable = false;
                    BlackEnable = false;
                    USeManager.Instance.Stop();
                    USeManager.Instance.Start();
                    isLogin = false;
                    IsLoginEvent?.Invoke(false);//触发注销成功事件
                }
            }
        }