public Product_buyruleInfo Save() { if (this.Id != null) { Product_buyrule.Update(this); return(this); } return(Product_buyrule.Insert(this)); }
public APIReturn _Add([FromForm] uint?Product_id, [FromForm] uint?Discount, [FromForm] uint?Ordering_end, [FromForm] uint?Ordering_start) { Product_buyruleInfo item = new Product_buyruleInfo(); item.Product_id = Product_id; item.Discount = Discount; item.Ordering_end = Ordering_end; item.Ordering_start = Ordering_start; item = Product_buyrule.Insert(item); return(APIReturn.成功.SetData("item", item.ToBson())); }
public Product_buyruleInfo AddBuyrule(uint?Discount, uint?Ordering_end, uint?Ordering_start) => Product_buyrule.Insert(new Product_buyruleInfo { Product_id = this.Id, Discount = Discount, Ordering_end = Ordering_end, Ordering_start = Ordering_start });