public ActionResult NewsContentAdd(int id,FormCollection f) { bizNewsContent bc = new bizNewsContent(); bizNews b = new bizNews(); bizNewsType bt = new bizNewsType(); List<NewsContent> list = bc.ListByNewsID(id); int pageID = list.Max(p => p.PageID) + 1; NewsContent modelContent = new NewsContent(); modelContent.PageID = pageID; modelContent.NewsID = id; if (f["ReID"].Trim()!="") modelContent.ReID = int.Parse(f["ReID"]); modelContent.Content = f["Content"]; bc.Add(modelContent); return RedirectToAction("NewsContentMod", new { id = id, pageID = pageID }); }
public ActionResult NewsAdd(News model,FormCollection f) { int parentID = Request.QueryString["parentID"] == null ? 0 : int.Parse(Request.QueryString["parentID"].ToString()); int typeID = Request.QueryString["typeID"] == null ? 0 : int.Parse(Request.QueryString["typeID"].ToString()); int bbsMainID = Request.QueryString["bbsMainID"] == null ? 0 : int.Parse(Request.QueryString["bbsMainID"].ToString()); bizNewsType bt = new bizNewsType(); bizNews b = new bizNews(); bizNewsContent bc = new bizNewsContent(); NewsContent modelContent = new NewsContent(); modelContent.Content = f["Content"]; model.AddIP = Public.CommonHelper.GetIPAddress(); int newsID=b.Add(model); modelContent.PageID = 1; modelContent.NewsID = newsID; bc.Add(modelContent); return RedirectToAction("NewsMod", new { id = newsID }); }