public static void FillDto(Models.Journal entity, ViewModels.JournalX journal) { journal.Id = entity.Id; journal.TypeId = entity.TypeId; journal.Title = entity.Title; journal.Remark = entity.Remark; journal.Website = entity.Website; }
public static void Fill(Models.Journal entity, ViewModels.JournalX journal) { entity.Id = journal.Id; entity.TypeId = journal.TypeId; entity.Title = journal.Title; entity.Remark = journal.Remark; entity.Website = journal.Website; }
public virtual CustomActionResult CanDelete(Models.Journal entity) { var books = this.context.Books.Count(q => q.JournalId == entity.Id); if (books > 0) { return(Exceptions.getCanNotDeleteException("Journal-03")); } return(new CustomActionResult(HttpStatusCode.OK, "")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Journal = await _context.Journal.FirstOrDefaultAsync(m => m.ID == id); if (Journal == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Journal = await _context.Journal.FindAsync(id); if (Journal != null) { _context.Journal.Remove(Journal); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }