コード例 #1
0
 public ActionResult AddTitleAndSubtitle()
 {
     if (loginStatus() == false)
     {
         return Redirect("Login");
     }
     var response = new Dictionary<string, string>();
     var title = Request.Params["title"];
     var subtitle = Request.Params["subtitle"];
     if (title == null || subtitle == null)
     {
         response.Add("status", "failed");
         response.Add("error", "bad param");
         return Json(response); 
     }
     var model = new TitleModel();
    int row =  model.setTitle(title, subtitle);
    if (row < 1)
    {
        response.Add("status", "failed");
        response.Add("error", "insert error");
        return Json(response);
    }
    response.Add("status", "success");
    return Json(response); 
 }
コード例 #2
0
ファイル: BaseController.cs プロジェクト: funtion/exam-aspx
 protected TitleEntity getTitle()
 {
     TitleModel model = new TitleModel();
     return model.getTitle();
 }