Пример #1
0
 public JsonResult KeyWords_Create(FormCollection form)
 {
     ResultBase_form result = new ResultBase_form();
     WX_KeyWord m = new WX_KeyWord();
     TryUpdateModel<WX_KeyWord>(m, form);
     m.CompanyID = UserDateTicket.Company.ID;
     m.ConfigID = UserDateTicket.wx_config.ID;
     switch (m.Type)
     {
         case 0://图文消息
             m.Content = "";
             break;
         case 1://文字
             m.RelationID = Guid.Empty;
             break;
         case 2://图片
             break;
         case 3://语音
             break;
         case 4: //视频
             break;
         case 5://API
             m.RelationID = Guid.Empty;
             break;
     }
     if (m.ID == Guid.Empty)
         result.status = WX_KeyWordService.instance().Insert(m);
     else
         result.status = WX_KeyWordService.instance().Update(m);
     result.msg = result.status == 0 ? "操作失败" : "操作成功";
     result.ResultURL = "/WeChat/KeyWords";
     return Json(result, JsonRequestBehavior.AllowGet);
 }
Пример #2
0
 public ActionResult KeyWords_Create(string id)
 {
     WX_KeyWord m;
     if (string.IsNullOrEmpty(id))
         m = new WX_KeyWord() { Type = 1 };
     else
         m = WX_KeyWordService.instance().Single(new Guid(id));
     return View(m);
 }