protected static MySqlParameter[] GetParameters(Member_securityInfo item) { return(new MySqlParameter[] { GetParameter("?member_id", MySqlDbType.UInt32, 10, item.Member_id), GetParameter("?password", MySqlDbType.VarChar, 255, item.Password) }); }
private static void RemoveCache(Member_securityInfo item) { if (item == null) { return; } RedisHelper.Remove(string.Concat("pifa_BLL_Member_security_", item.Member_id)); }
public static pifa.DAL.Member_security.SqlUpdateBuild UpdateDiy(Member_securityInfo item, uint Member_id) { if (itemCacheTimeout > 0) { RemoveCache(item != null ? item : GetItem(Member_id)); } return(new pifa.DAL.Member_security.SqlUpdateBuild(item, Member_id)); }
public static int Update(Member_securityInfo item) { if (itemCacheTimeout > 0) { RemoveCache(item); } return(dal.Update(item)); }
public APIReturn _Add([FromForm] uint?Member_id, [FromForm] string Password) { Member_securityInfo item = new Member_securityInfo(); item.Member_id = Member_id; item.Password = Password; item = Member_security.Insert(item); return(APIReturn.成功.SetData("item", item.ToBson())); }
public static Member_securityInfo Insert(Member_securityInfo item) { item = dal.Insert(item); if (itemCacheTimeout > 0) { RemoveCache(item); } return(item); }
public ActionResult Edit([FromQuery] uint Member_id) { Member_securityInfo item = Member_security.GetItem(Member_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } ViewBag.item = item; return(View()); }
public object GetItem(IDataReader dr, ref int index) { Member_securityInfo item = new Member_securityInfo(); if (!dr.IsDBNull(++index)) { item.Member_id = (uint?)dr.GetInt32(index); } if (!dr.IsDBNull(++index)) { item.Password = dr.GetString(index); } return(item); }
public APIReturn _Edit([FromQuery] uint Member_id, [FromForm] string Password) { Member_securityInfo item = Member_security.GetItem(Member_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } item.Password = Password; int affrows = Member_security.Update(item); if (affrows > 0) { return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}")); } return(APIReturn.失败); }
public static Member_securityInfo GetItem(uint Member_id) { if (itemCacheTimeout <= 0) { return(Select.WhereMember_id(Member_id).ToOne()); } string key = string.Concat("pifa_BLL_Member_security_", Member_id); string value = RedisHelper.Get(key); if (!string.IsNullOrEmpty(value)) { try { return(Member_securityInfo.Parse(value)); } catch { } } Member_securityInfo item = Select.WhereMember_id(Member_id).ToOne(); if (item == null) { return(null); } RedisHelper.Set(key, item.Stringify(), itemCacheTimeout); return(item); }
public SqlUpdateBuild(Member_securityInfo item, uint Member_id) { _item = item; _where = SqlHelper.Addslashes("`member_id` = {0}", Member_id); }
public int Update(Member_securityInfo item) { return(new SqlUpdateBuild(null, item.Member_id.Value) .SetPassword(item.Password).ExecuteNonQuery()); }
public Member_securityInfo Insert(Member_securityInfo item) { SqlHelper.ExecuteNonQuery(TSQL.Insert, GetParameters(item)); return(item); }