Example #1
0
        public ActionResult Create(Author author)
        {
            if (ModelState.IsValid)
            {
                author.IsActive = true;

                if (authorManager.Insert(author) > 0)
                {
                    OkViewModel ok = new OkViewModel()
                    {
                        Title          = "Yazar ekleme işleminiz başarılı",
                        RedirectingUrl = "/Author/Index"
                    };

                    return(View("Ok", ok));
                }
                ErrorViewModel error = new ErrorViewModel()
                {
                    Title          = "Yazar ekleme işleminiz başarısız",
                    RedirectingUrl = "/Author/Index"
                };
                return(View("Error", error));
            }

            return(View(author));
        }