public static List <TeammemberEntity> GetRawMembers(Guid managerId, bool syncFlag = true, string siteId = "") { try { List <TeammemberEntity> list = null; if (syncFlag) { list = MemcachedFactory.TeammembersClient.Get <List <TeammemberEntity> >(managerId); } if (null != list && list.Count > 0) { return(list); } list = TeammemberMgr.GetByManager(managerId, ShareUtil.GetTableMod(managerId), siteId); TeammemberGrowEntity grow = null; var growList = TeammemberGrowMgr.GetByManager(managerId, siteId); foreach (var entity in list) { if (!entity.IsHirePlayer) { grow = growList.Find(d => d.Idx == entity.Idx); if (grow != null) { entity.GrowLevel = grow.GrowLevel; } } if (entity.UsedPlayerCard != null && entity.UsedPlayerCard.Length > 0) { entity.PlayerCard = SerializationHelper.FromByte <PlayerCardUsedEntity>(entity.UsedPlayerCard); } if (entity.UsedEquipment != null && entity.UsedEquipment.Length > 0) { entity.Equipment = SerializationHelper.FromByte <EquipmentUsedEntity>(entity.UsedEquipment); } TeammemberDataHelper.CalPropertyCount(entity); if (entity.IsHirePlayer) { TeammemberDataHelper.CalMaxGrow(entity, null); } else { TeammemberDataHelper.CalMaxGrow(entity, grow, siteId); } entity.RawProperty = new TeammemberPropertyEntity(entity); } if (syncFlag && list.Count > 0) { MemcachedFactory.TeammembersClient.Set(managerId, list); } return(list); } catch (Exception ex) { SystemlogMgr.Error("GetRawMembers", string.Format("mid:{0}", managerId), ex); throw ex; } }
public TeammemberGrowEntity GetTeammemberGrow(Guid managerId, Guid teammemberId) { TeammemberGrowEntity entity = TeammemberGrowMgr.GetById(teammemberId); if (entity == null || entity.ManagerId != managerId) { return(null); } CalTeammemberGrowData(entity); return(entity); }
/// <summary> /// 球员成长里的球员列表 /// </summary> /// <param name="managerId"></param> /// <returns></returns> public TeammemberListForGrowResponse GetTeammemberListForGrow(Guid managerId) { var teammembers = MatchDataHelper.GetTeammembers(managerId); var grows = TeammemberGrowMgr.GetByManager(managerId); var response = ResponseHelper.CreateSuccess <TeammemberListForGrowResponse>(); response.Data = new TeammemberListForGrowEntity(); response.Data.Teammembers = new List <TeammemberForGrowEntity>(teammembers.Count); foreach (var entity in teammembers) { response.Data.Teammembers.Add(BuildTeammemberForGrow(entity, grows)); } return(response); }
public static void CalMaxGrow(TeammemberEntity entity, TeammemberGrowEntity grow, string siteId = "") { int growLevel = 1; if (grow == null) { grow = TeammemberGrowMgr.GetById(entity.Idx, siteId); } if (grow != null) { growLevel = grow.GrowLevel; } var playerCache = CacheFactory.PlayersdicCache.GetPlayer(entity.PlayerId); }
void BindData() { var accountData = Master.GetAccount(); if (accountData == null) { Master.ShowMessage("请先选择经理."); return; } ClearData(); var list = TeammemberGrowMgr.GetByManager(accountData.ManagerId, accountData.ZoneId); if (list == null) { Master.ShowMessage("没有数据."); return; } datagrid1.DataSource = list; datagrid1.DataBind(); }