public void SaveStory(Story Story) { if (Story.Id == 0) { _RStory.Add(Story); } else { _uow.Entry(Story).State = EntityState.Modified; } _uow.SaveChanges(); }
public ActionResult SaveStory(string Title, string ShortDes, string LongDes, bool IsShow, string Tags ,string metaDescription) { if (IsValidSessions()) { TempData["result"] = "OK"; Story Story = new Story(); Story.IsShow = !IsShow; Story.Title = Title; Story.ShortDes = ShortDes; Story.LongDes = LongDes; Story.Tags = Tags; Story.metaDescription = metaDescription; Story.LanguageId = Convert.ToInt32(Session["Language"].ToString()); Story.CreationDate = DateTime.Now.Date; _RStory.SaveStory(Story); TempData["Folder"] = Story.Id; TempData["result"] = "OK"; TempData["Message"] = "عملیات با موفقیت انجام شد."; return Json(new { Idms = Story.Id }, JsonRequestBehavior.AllowGet); } else return RedirectToAction("Login", "Home"); }
public void DeleteStory(Story Story) { _RStory.Remove(Story); _uow.SaveChanges(); }