public Product_attrInfo Save() { if (this.Pattr_id != null && this.Product_id != null) { Product_attr.Update(this); return(this); } return(Product_attr.Insert(this)); }
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.失败); }