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