public List <DTOBuffValue> GetManagerShowBuffList(Guid managerId) { bool syncFlag = true; var values = GetBuffValues(managerId, EnumBuffUnitType.ManagerShow, true, syncFlag, BuffCache.BUFFCodes4ManagerShow); if (null == values || values.Length == 0) { return(null); } var list = new List <DTOBuffValue>(values.Length); foreach (var item in values) { if (null != item.SrcList) { list.Add(item); } } DicBuffEntity buffCfg = null; foreach (var item in list) { if (BuffCache.Instance().TryGetBuff(out buffCfg, item.BuffId)) { item.BuffName = buffCfg.BuffName; item.Icon = buffCfg.Icon; item.BuffMemo = string.Format(buffCfg.Memo, item.Point, item.Percent); } foreach (var srcItem in item.SrcList) { srcItem.SkillName = BuffCache.Instance().GetSkillName(srcItem.SkillCode, srcItem.SkillLevel); } } return(list); }
/// <summary> /// 带事务的Update /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2015/10/19 10:49:19</remarks> public bool Update(DicBuffEntity entity, DbTransaction trans) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_DicBuff_Update"); database.AddInParameter(commandWrapper, "@BuffId", DbType.Int32, entity.BuffId); database.AddInParameter(commandWrapper, "@BuffName", DbType.String, entity.BuffName); database.AddInParameter(commandWrapper, "@BuffType", DbType.Int32, entity.BuffType); database.AddInParameter(commandWrapper, "@BaseFlag", DbType.Boolean, entity.BaseFlag); database.AddInParameter(commandWrapper, "@BaseBuffMap", DbType.AnsiString, entity.BaseBuffMap); database.AddInParameter(commandWrapper, "@Icon", DbType.AnsiString, entity.Icon); database.AddInParameter(commandWrapper, "@Memo", DbType.String, entity.Memo); database.AddInParameter(commandWrapper, "@RowTime", DbType.DateTime, entity.RowTime); int results = 0; if (trans != null) { results = database.ExecuteNonQuery(commandWrapper, trans); } else { results = database.ExecuteNonQuery(commandWrapper); } return(Convert.ToBoolean(results)); }
public BuffTipsEntity(DicBuffEntity dic) { this.BuffId = dic.BuffId; this.BuffName = dic.BuffName; this.Icon = dic.Icon; this.BuffMemo = dic.Memo; }
/// <summary> /// 将IDataReader的当前记录读取到DicBuffEntity 对象 /// </summary> /// <param name="reader"></param> /// <returns></returns> public DicBuffEntity LoadSingleRow(IDataReader reader) { var obj = new DicBuffEntity(); obj.BuffId = (System.Int32)reader["BuffId"]; obj.BuffName = (System.String)reader["BuffName"]; obj.BuffType = (System.Int32)reader["BuffType"]; obj.BaseFlag = (System.Boolean)reader["BaseFlag"]; obj.BaseBuffMap = (System.String)reader["BaseBuffMap"]; obj.Icon = (System.String)reader["Icon"]; obj.Memo = (System.String)reader["Memo"]; obj.RowTime = (System.DateTime)reader["RowTime"]; return(obj); }
/// <summary> /// GetById /// </summary> /// <param name="buffId">buffId</param> /// <returns>DicBuffEntity</returns> /// <remarks>2015/10/19 10:49:19</remarks> public DicBuffEntity GetById(System.Int32 buffId) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("P_DicBuff_GetById"); database.AddInParameter(commandWrapper, "@BuffId", DbType.Int32, buffId); DicBuffEntity obj = null; using (IDataReader reader = database.ExecuteReader(commandWrapper)) { if (reader.Read()) { obj = LoadSingleRow(reader); } } return(obj); }
public bool TryGetBuff(out DicBuffEntity cfg, int buffId) { s_dicBuff.TryGetValue(buffId, out cfg); return(null != cfg); }
/// <summary> /// Update /// </summary> /// <param name="entity"></param> /// <returns></returns> /// <remarks>2015/10/19 10:49:19</remarks> public bool Update(DicBuffEntity entity) { return(Update(entity, null)); }
/// <summary> /// Insert /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2015/10/19 10:49:19</remarks> public bool Insert(DicBuffEntity entity) { return(Insert(entity, null)); }
public static bool Update(DicBuffEntity dicBuffEntity, DbTransaction trans = null, string zoneId = "") { var provider = new DicBuffProvider(zoneId); return(provider.Update(dicBuffEntity, trans)); }