Ejemplo n.º 1
0
        private void mView_Send(object sender, EventArgs e)
        {
            var dto = new DtoAuthor {
                AuthorId = mView.AuthorId, FirstName = mView.FirstName, LastName = mView.LastName
            };

            if (dto.AuthorId > 0)
            {
                mView.Message = _authorDm.Update(dto);
            }
            else
            {
                mView.Message = _authorDm.Add(dto);
            }
        }
Ejemplo n.º 2
0
        public IActionResult OnPost(string submit)
        {
            if (submit == "Cancel")
            {
                return(RedirectToPage("Index"));
            }

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _authorDm.Update(Author);

            return(RedirectToPage("Index"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit(int id = 0)
 {
     return(id == 0 ? null : View(adm.Update(id)));
 }