Ejemplo n.º 1
0
        public ActionResult Details(Guid id)
        {
            var info  = service.GetById(id);
            var model = new MessageOpenMechanismModel().ToModel(info);

            return(View(PluginHelper.GetViewPath(this.GetType(), "Details"), model));
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            var model = new MessageOpenMechanismModel();
            var name  = Session["User"] as User;

            model.publicName = name.Name;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
Ejemplo n.º 3
0
        public ActionResult Edit(Guid id)
        {
            var info = service.GetById(id);

            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            var model = new MessageOpenMechanismModel().ToModel(info);
            var name  = Session["User"] as User;

            model.publicName = name.Name;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
Ejemplo n.º 4
0
 public ActionResult Edit(MessageOpenMechanismModel model)
 {
     if (ModelState.IsValid)
     {
         var info = service.GetById(model.Id);
         if (info != null)
         {
             info = model.FormData(info);
             service.Update(info);
             return(Json(new AjaxResult()
             {
                 Result = Result.Success
             }));
         }
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
 }
Ejemplo n.º 5
0
 public ActionResult Create(MessageOpenMechanismModel model)
 {
     if (ModelState.IsValid)
     {
         int result = service.GetMessageOpenMechanismCount();
         if (result > 0)
         {
             ModelState.AddModelError("Name", "只包含一条信息,您可以选择编辑修改此项");
         }
         else
         {
             service.Add(model.ToInfo());
             return(Json(new AjaxResult()
             {
                 Result = Result.Success
             }));
         }
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }