public ActionResult Details(Guid id)
        {
            var info  = service.GetById(id);
            var model = new MessageOpenAnnualModel().ToModel(info);

            return(View(PluginHelper.GetViewPath(this.GetType(), "Details"), model));
        }
        public ActionResult Edit(Guid id)
        {
            var info = service.GetById(id);

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

            model.publicName = name.Name;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
        public ActionResult Create()
        {
            var model = new MessageOpenAnnualModel();

            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            var name = Session["User"] as User;

            model.publicName = name.Name;
            model.publicTime = DateTime.Now;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
 public ActionResult Edit(MessageOpenAnnualModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.OrganizationList == null || model.OrganizationList.Count <= 0)
         {
             ModelState.AddModelError("Department", "所属组织不能为空");
             ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
             return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
         }
         string department = string.Empty;
         if (model.OrganizationList != null && model.OrganizationList.Count > 0)
         {
             var OrganizationId = DataDictionaryHelper.GetOrganizationByName("所属组织");
             for (int i = 0; i < model.OrganizationList.Count; i++)
             {
                 if (model.OrganizationList[i] != OrganizationId)
                 {
                     if (i > 0)
                     {
                         department += ",";
                     }
                     department += model.OrganizationList[i].ToString();
                 }
             }
         }
         var info = service.GetById(model.Id);
         model.Department = department;
         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));
 }