public Shop_friendly_linksInfo Save() { if (this.Id != null) { Shop_friendly_links.Update(this); return(this); } this.Create_time = DateTime.Now; return(Shop_friendly_links.Insert(this)); }
public APIReturn _Edit([FromQuery] uint Id, [FromForm] uint?Shop_id, [FromForm] byte?Sort, [FromForm] string Title, [FromForm] string Url) { Shop_friendly_linksInfo item = Shop_friendly_links.GetItem(Id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } item.Shop_id = Shop_id; item.Create_time = DateTime.Now; item.Sort = Sort; item.Title = Title; item.Url = Url; int affrows = Shop_friendly_links.Update(item); if (affrows > 0) { return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}")); } return(APIReturn.失败); }