public static Raffle_info_tblInfo GetItemByGateAndTel(string Gate, string Tel) { if (Gate == null || Tel == null) { return(null); } if (itemCacheTimeout <= 0) { return(dal.GetItemByGateAndTel(Gate, Tel)); } string key = string.Concat("DC2016_BLL_Raffle_info_tblByGateAndTel_", Gate, "_,_", Tel); string value = RedisHelper.Get(key); if (!string.IsNullOrEmpty(value)) { try { return(new Raffle_info_tblInfo(value)); } catch { } } Raffle_info_tblInfo item = dal.GetItemByGateAndTel(Gate, Tel); if (item == null) { return(null); } RedisHelper.Set(key, item.Stringify(), itemCacheTimeout); return(item); }
public static Raffle_info_tblInfo GetItem(uint?Id) { if (Id == null) { return(null); } if (itemCacheTimeout <= 0) { return(dal.GetItem(Id)); } string key = string.Concat("DC2016_BLL_Raffle_info_tbl_", Id); string value = RedisHelper.Get(key); if (!string.IsNullOrEmpty(value)) { try { return(new Raffle_info_tblInfo(value)); } catch { } } Raffle_info_tblInfo item = dal.GetItem(Id); if (item == null) { return(null); } RedisHelper.Set(key, item.Stringify(), itemCacheTimeout); return(item); }
public static DC2016.DAL.Raffle_info_tbl.SqlUpdateBuild UpdateDiy(Raffle_info_tblInfo item, uint?Id) { if (itemCacheTimeout > 0) { RemoveCache(item != null ? item : GetItem(Id)); } return(new DC2016.DAL.Raffle_info_tbl.SqlUpdateBuild(item, Id)); }
public static int Update(Raffle_info_tblInfo item) { if (itemCacheTimeout > 0) { RemoveCache(item); } return(dal.Update(item)); }
private static void RemoveCache(Raffle_info_tblInfo item) { if (item == null) { return; } RedisHelper.Remove(string.Concat("DC2016_BLL_Raffle_info_tbl_", item.Id)); RedisHelper.Remove(string.Concat("DC2016_BLL_Raffle_info_tblByGateAndTel_", item.Gate, "_,_", item.Tel)); }
public static Raffle_info_tblInfo Insert(Raffle_info_tblInfo item) { item = dal.Insert(item); if (itemCacheTimeout > 0) { RemoveCache(item); } return(item); }
public int Update(Raffle_info_tblInfo item) { return(new SqlUpdateBuild(null, item.Id) .SetActiveid(item.Activeid) .SetGate(item.Gate) .SetRewarditem(item.Rewarditem) .SetState(item.State) .SetTel(item.Tel) .SetTime(item.Time).ExecuteNonQuery()); }
public Raffle_info_tblInfo Insert(Raffle_info_tblInfo item) { uint loc1; if (uint.TryParse(string.Concat(SqlHelper.ExecuteScalar(TSQL.Insert, GetParameters(item))), out loc1)) { item.Id = loc1; } return(item); }
protected static MySqlParameter[] GetParameters(Raffle_info_tblInfo item) { return(new MySqlParameter[] { GetParameter("?id", MySqlDbType.UInt32, 10, item.Id), GetParameter("?activeid", MySqlDbType.VarChar, 32, item.Activeid), GetParameter("?gate", MySqlDbType.VarChar, 8, item.Gate), GetParameter("?rewarditem", MySqlDbType.Int32, 11, item.Rewarditem), GetParameter("?state", MySqlDbType.Int32, 11, item.State), GetParameter("?tel", MySqlDbType.VarChar, 18, item.Tel), GetParameter("?time", MySqlDbType.DateTime, -1, item.Time) }); }
public SqlUpdateBuild(Raffle_info_tblInfo item, uint?Id) { _item = item; _where = SqlHelper.Addslashes("`id` = {0}", Id); }