public ServerResponse<BookRemark> SaveBookRemark(string personId, string personName, string userType, string bookId, int pageNo, [FromBody]PageRemark remark) { ServerResponse<BookRemark> result = new ServerResponse<BookRemark>(); BookRemark obj = new BookRemark() { BookId = bookId, PageNo = pageNo, PersonId = personId, PersonName = personName, Title = remark.Title, Description = remark.Description, ImageUrl = remark.ImageUrl, LinkUrl = remark.LinkUrl, RemarkTime = DateTime.Now, RemarkType = remark.RemarkType, ContentType = remark.ContentType, Top = remark.Top, Left = remark.Left, Width = remark.Width, Height = remark.Height, TopMost = remark.TopMost }; try { if (bookProvider.SaveRemark(obj)) { result.Status = ResponseStatus.Success; result.Message = DAF.Core.Resources.Locale(o => o.SaveSuccessfully); result.Data = obj; } else { result.Status = ResponseStatus.Failed; result.Message = DAF.Core.Resources.Locale(o => o.SaveFailure); } } catch (Exception ex) { result.Status = ResponseStatus.Exception; result.Message = ex.Message; } return result; }
public bool SaveRemark(BookRemark remark) { if (string.IsNullOrEmpty(remark.RemarkId)) { remark.RemarkId = generator.NewId(); } bool result = repoBookRemark.Save(o => o.RemarkId == remark.RemarkId, remark); return result; }