// Get a single guide entry from the database // Return the view of viewName and pass it a GuideEditModel public ActionResult GetEntry(int ID, string Type, string viewName) { Database.Connect(); Dictionary <string, object> dict = Database.SelectRow("SELECT * FROM Guide" + Type + " WHERE ID = " + ID, null); Database.CloseConnection(); GuideEditModel model = new GuideEditModel(dict, Type); return(View(viewName, model)); }
public ActionResult Edit(GuideEditModel model) { bool isok = GuideSvc.UpdateGuide(model.id, model.school, model.intro); if (isok) { return(Json(new AjaxResult { status = "ok" })); } return(Json(new AjaxResult { status = "error" })); }
public UpdateGuideCommand(GuideEditModel model) { Model = model; }