示例#1
0
        //private bool CopyData()
        //{
        //    int returnValue = 0 ;
        //    string returnMsg = string.Empty;


        //    NbManagerMgr.TransferZoneByAccount("", _accountDataOld.Account, _accountDataOld.Name, _accountDataOld.ManagerId.ToString(), _accountDataOld.Mod.ToString(), _accountDataNew.Account,
        //        _accountDataNew.Name, _accountDataNew.ManagerId.ToString(), _accountDataNew.Mod.ToString(),  ref returnValue,  ref returnMsg);



        //    return true;
        //}

        private bool GetManagerByName(string name, string zoneId, bool oldOrNew)
        {
            if (!string.IsNullOrEmpty(name))
            {
                var manager = NbManagerMgr.GetByName(name, zoneId);
                if (manager != null)
                {
                    SetAccount(manager, zoneId, oldOrNew);
                    return(true);
                }
            }
            return(false);
        }
        private bool GetManagerByName(string zoneId)
        {
            var name = txtManagerName.Text.Trim();

            if (!string.IsNullOrEmpty(name))
            {
                var manager = NbManagerMgr.GetByName(name, zoneId);
                if (manager != null)
                {
                    SetAccount(manager, zoneId);
                    return(true);
                }
            }
            return(false);
        }
示例#3
0
        /// <summary>
        /// 批量获取玩家信息
        /// </summary>
        /// <param name="data">json</param>
        /// <returns></returns>
        public List <NbManagerEntity> IsRegistByNameList(string data)
        {
            data = "{\"data\":" + data + "}";
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            var listData = new OtherTweJsonEntity();

            try
            {
                listData = serializer.Deserialize <OtherTweJsonEntity>(data);
            }
            catch (Exception e)
            {
                SystemlogMgr.Info("IsRegistByNameList", e.Message + "|json解析错误");
                return(null);
            }
            if (listData == null || listData.Data == null || listData.Data.Count == 0)
            {
                SystemlogMgr.Info("IsRegistByNameList", "参数为空");

                return(null);
            }
            SystemlogMgr.Info("IsRegistByNameList", listData.Data.Count + "|计数");

            var list = new List <NbManagerEntity>();

            foreach (var entity in listData.Data)
            {
                var manager = new NbManagerEntity();
                manager = NbManagerMgr.GetByName(entity.Name);
                if (manager == null || manager.Name != entity.Name)
                {
                    SystemlogMgr.Info("IsRegistByNameList", entity.Name + "不存在" + manager.Name);
                    return(null);
                }
                list.Add(manager);
            }
            return(list);
        }