public object GetItem(IDataReader dr, ref int index) { Order_addressInfo item = new Order_addressInfo(); if (!dr.IsDBNull(++index)) { item.Order_id = (uint?)dr.GetInt32(index); } if (!dr.IsDBNull(++index)) { item.Address = dr.GetString(index); } if (!dr.IsDBNull(++index)) { item.Name = dr.GetString(index); } if (!dr.IsDBNull(++index)) { item.Tel = dr.GetString(index); } if (!dr.IsDBNull(++index)) { item.Telphone = dr.GetString(index); } if (!dr.IsDBNull(++index)) { item.Zip = dr.GetString(index); } return(item); }
private static void RemoveCache(Order_addressInfo item) { if (item == null) { return; } RedisHelper.Remove(string.Concat("pifa_BLL_Order_address_", item.Order_id)); }
public static pifa.DAL.Order_address.SqlUpdateBuild UpdateDiy(Order_addressInfo item, uint Order_id) { if (itemCacheTimeout > 0) { RemoveCache(item != null ? item : GetItem(Order_id)); } return(new pifa.DAL.Order_address.SqlUpdateBuild(item, Order_id)); }
public static int Update(Order_addressInfo item) { if (itemCacheTimeout > 0) { RemoveCache(item); } return(dal.Update(item)); }
public int Update(Order_addressInfo item) { return(new SqlUpdateBuild(null, item.Order_id.Value) .SetAddress(item.Address) .SetName(item.Name) .SetTel(item.Tel) .SetTelphone(item.Telphone) .SetZip(item.Zip).ExecuteNonQuery()); }
public static Order_addressInfo Insert(Order_addressInfo item) { item = dal.Insert(item); if (itemCacheTimeout > 0) { RemoveCache(item); } return(item); }
public ActionResult Edit([FromQuery] uint Order_id) { Order_addressInfo item = Order_address.GetItem(Order_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } ViewBag.item = item; return(View()); }
protected static MySqlParameter[] GetParameters(Order_addressInfo item) { return(new MySqlParameter[] { GetParameter("?order_id", MySqlDbType.UInt32, 10, item.Order_id), GetParameter("?address", MySqlDbType.VarChar, 255, item.Address), GetParameter("?name", MySqlDbType.VarChar, 32, item.Name), GetParameter("?tel", MySqlDbType.VarChar, 32, item.Tel), GetParameter("?telphone", MySqlDbType.VarChar, 32, item.Telphone), GetParameter("?zip", MySqlDbType.VarChar, 16, item.Zip) }); }
public APIReturn _Add([FromForm] uint?Order_id, [FromForm] string Address, [FromForm] string Name, [FromForm] string Tel, [FromForm] string Telphone, [FromForm] string Zip) { Order_addressInfo item = new Order_addressInfo(); item.Order_id = Order_id; item.Address = Address; item.Name = Name; item.Tel = Tel; item.Telphone = Telphone; item.Zip = Zip; item = Order_address.Insert(item); return(APIReturn.成功.SetData("item", item.ToBson())); }
public APIReturn _Edit([FromQuery] uint Order_id, [FromForm] string Address, [FromForm] string Name, [FromForm] string Tel, [FromForm] string Telphone, [FromForm] string Zip) { Order_addressInfo item = Order_address.GetItem(Order_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } item.Address = Address; item.Name = Name; item.Tel = Tel; item.Telphone = Telphone; item.Zip = Zip; int affrows = Order_address.Update(item); if (affrows > 0) { return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}")); } return(APIReturn.失败); }
public static Order_addressInfo GetItem(uint Order_id) { if (itemCacheTimeout <= 0) { return(Select.WhereOrder_id(Order_id).ToOne()); } string key = string.Concat("pifa_BLL_Order_address_", Order_id); string value = RedisHelper.Get(key); if (!string.IsNullOrEmpty(value)) { try { return(Order_addressInfo.Parse(value)); } catch { } } Order_addressInfo item = Select.WhereOrder_id(Order_id).ToOne(); if (item == null) { return(null); } RedisHelper.Set(key, item.Stringify(), itemCacheTimeout); return(item); }
public Order_addressInfo Insert(Order_addressInfo item) { SqlHelper.ExecuteNonQuery(TSQL.Insert, GetParameters(item)); return(item); }
public SqlUpdateBuild(Order_addressInfo item, uint Order_id) { _item = item; _where = SqlHelper.Addslashes("`order_id` = {0}", Order_id); }