public ActionResult ArticleSave(RoomArticle model)//-----------------------------------------新添加一个博客保存功能 { var article = new RoomArticle(); article.Subject = model.Subject; article.Body = model.Body; article.Khage = model.Khage; article.Id = model.Id; article.Khid = model.Khid; article.Khname = model.Khname; article.Khphone = model.Khphone; article.Khsex = model.Khsex; article.Roomid = model.Roomid; article.Rzdate = model.Rzdate; article.Rzid = model.Rzid; article.RzTfdate = model.RzTfdate; article.DateCreated = DateTime.Now; var db = new OsDatabase(); db.RoomArticles.Add(article); db.SaveChanges(); return(Redirect("Index")); }
public ActionResult Delete(int id)//-----------------------------------------新添加一个博客删除 { var db = new OsDatabase(); var article = db.RoomArticles.First(o => o.Id == id); db.RoomArticles.Remove(article); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult SetupNM(Admain model) { var account = new Admain(); account.Id = model.Id; account.UserName = model.UserName; account.UserMima = model.UserMima; var db = new OsDatabase(); db.Admins.Add(account); db.SaveChanges(); return(Redirect("LoginView")); }
public ActionResult ChangeSave(int id, string subject, string body, string Khname, int Khage, string Khsex, string Khid, string Khphone, string Roomid, string Rzid, DateTime Rzdate, DateTime RzTfdate)//-----------------------------------------新添加一个博客修改刷新功能 { var db = new OsDatabase(); var article = db.RoomArticles.First(o => o.Id == id); article.Subject = subject; article.Body = body; article.Khage = Khage; article.Id = id; article.Khid = Khid; article.Khname = Khname; article.Khphone = Khphone; article.Khsex = Khsex; article.Roomid = Roomid; article.Rzdate = Rzdate; article.Rzid = Rzid; article.RzTfdate = RzTfdate; db.SaveChanges(); return(RedirectToAction("Index")); }