public static List <DTOWorthItem> GetWorthList(Guid managerId, WorthSource worthSrc, params EnumWorthType[] worthTypes) { var lst = new List <DTOWorthItem>(); foreach (var worthType in worthTypes) { lst.Add(new DTOWorthItem { WorthType = (int)worthType, Value = GetWorthValue(managerId, worthSrc, worthType), CostValue = 0, }); } return(lst); }
public static long GetWorthValue(Guid managerId, WorthSource worthSrc, EnumWorthType worthType) { long val = -1; try { if (null == worthSrc) { worthSrc = new WorthSource(); } if (null == worthSrc.Manager) { worthSrc.Manager = NbManagerMgr.GetById(managerId); } if (null == worthSrc.Manager) { return(val); } switch (worthType) { case EnumWorthType.Gold: if (null == worthSrc.Account) { worthSrc.Account = GetPayAccount(worthSrc.Manager.Account); } return(worthSrc.Account.TotalPoint); case EnumWorthType.Coin: return(worthSrc.Manager.Coin); case EnumWorthType.ManagerLevel: return(worthSrc.Manager.Level); case EnumWorthType.VipLevel: return(worthSrc.Manager.VipLevel); } } catch (Exception ex) { SystemlogMgr.Error("FrameConvert:GetWorthValue", ex); } return(val); }
public static WorthSource GetWorthSource(Guid managerId, bool managerFlag, bool accountFlag, string siteId = "") { var obj = new WorthSource(); try { if (managerFlag || accountFlag) { obj.Manager = NbManagerMgr.GetById(managerId, siteId); } if (accountFlag) { obj.Account = GetPayAccount(obj.Manager.Account, siteId); } } catch (Exception ex) { SystemlogMgr.Error("FrameConvert:GetWorthSource", ex); } return(obj); }
public static long GetWorthValue(Guid managerId, EnumWorthType worthType) { var worthSrc = new WorthSource(); return(GetWorthValue(managerId, worthSrc, worthType)); }
public static List <DTOWorthItem> GetWorthList(Guid managerId, params EnumWorthType[] worthTypes) { var worthSrc = new WorthSource(); return(GetWorthList(managerId, worthSrc, worthTypes)); }