public ActionResult Edit([FromQuery] uint Pattr_id, [FromQuery] uint Product_id) { Product_attrInfo item = Product_attr.GetItem(Pattr_id, Product_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } ViewBag.item = item; return(View()); }
public APIReturn _Edit([FromQuery] uint Pattr_id, [FromQuery] uint Product_id, [FromForm] string Value) { Product_attrInfo item = Product_attr.GetItem(Pattr_id, Product_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } item.Value = Value; int affrows = Product_attr.Update(item); if (affrows > 0) { return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}")); } return(APIReturn.失败); }
public Product_attrInfo FlagAttr(uint?Pattr_id, string Value) { Product_attrInfo item = Product_attr.GetItem(Pattr_id.Value, this.Id.Value); if (item == null) { item = Product_attr.Insert(new Product_attrInfo { Pattr_id = Pattr_id, Product_id = this.Id, Value = Value }); } else { item.UpdateDiy .SetValue(Value).ExecuteNonQuery(); } return(item); }