public FriendshipLinkVM(FriendshipLink bo) { Id = bo.Id; Name = bo.Name; Description = bo.Description; CreateTime = bo.CreateTime; Link = bo.Link; IsBlank = bo.IsBlank; }
public async Task <IActionResult> CreateOrUpdateFriendshipLinks(FriendshipLinkInput f) { FriendshipLink model = null; if (f.IsNew) { model = new FriendshipLink { Name = f.Name, Link = f.Link, Description = f.Description, IsBlank = f.IsBlank }; } else { model = await _friendshipLink.GetSingleAsyn(f.Id); if (model != null) { model.Name = f.Name; model.Link = f.Link; model.Description = f.Description; model.IsBlank = f.IsBlank; } else { return(Json(new { isOk = false, message = "数据不存在,更新失败!" })); } } var result = await _friendshipLink.AddOrEditAndSaveAsyn(model); if (!result) { return(Json(new { isOk = false, message = "操作失败!" })); } return(Json(new { isOk = true, message = "操作成功!" })); }
protected void Page_Load(object sender, EventArgs e) { flinklist.DataSource = FriendshipLink.Get_DataTable(1000); flinklist.DataBind(); }