Ejemplo n.º 1
0
        public async Task <ActionResult> Create(DomainLayer.DB_Model.News.News newsModel)
        {
            if (ModelState.IsValid)
            {
                newsModel.OwnerUserId = Guid.Parse(User.Identity.GetUserId());
                var result = await _newsServices.CreateNewsAsync(newsModel);

                if (result.Success)
                {
                    return(RedirectToAction("Index", "News", new { @area = "News" }));
                }

                ModelState.AddModelError("", "Error In Savin DataBase Please Tell SystemAdministrator");
            }
            else
            {
                ModelState.AddModelError("", "Your Information Not Valid For Save To DataBase Check Again");
            }

            return(View(newsModel));
        }