Esempio n. 1
0
        // 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));
        }
Esempio n. 2
0
        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"
            }));
        }
Esempio n. 3
0
 public UpdateGuideCommand(GuideEditModel model)
 {
     Model = model;
 }