Exemplo n.º 1
0
        public ActionResult Edit(WorkNoticeModel model)
        {
            if (model != null)
            {
                var info = service.GetById(model.Id);
                if (info != null)
                {
                    string department = string.Empty;
                    if (model.OrganizationList != null && model.OrganizationList.Count > 0)
                    {
                        for (int i = 0; i < model.OrganizationList.Count; i++)
                        {
                            if (i > 0)
                            {
                                department += ",";
                            }
                            department += model.OrganizationList[i].ToString();
                        }
                    }

                    info            = model.FormData(info);
                    info.Department = department;
                    service.UpdateGoogleProductRecord(info);
                    return(Json(new AjaxResult()
                    {
                        Result = Result.Success, Message = "操作成功"
                    }));
                }
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
Exemplo n.º 2
0
 public ActionResult Create(WorkNoticeModel model)
 {
     if (model != null)
     {
         string department = string.Empty;
         if (model.OrganizationList != null && model.OrganizationList.Count > 0)
         {
             for (int i = 0; i < model.OrganizationList.Count; i++)
             {
                 if (i > 0)
                 {
                     department += ",";
                 }
                 department += model.OrganizationList[i].ToString();
             }
         }
         WorkNotices WorkNotices = model.ToInfo();
         WorkNotices.Department = department;
         service.InsertGoogleProductRecord(WorkNotices);
         return(Json(new AjaxResult()
         {
             Result = Result.Success, Message = "操作成功"
         }));
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
Exemplo n.º 3
0
        public ActionResult Details(Guid id)
        {
            var info  = service.GetById(id);
            var model = new WorkNoticeModel().ToModel(info);

            return(View(PluginHelper.GetViewPath(this.GetType(), "Details"), model));
        }
Exemplo n.º 4
0
        public ActionResult Edit(Guid id)
        {
            var info  = service.GetById(id);
            var model = new WorkNoticeModel().ToModel(info);

            ViewBag.Organization = TreeHtml.GetListOrganization();
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
Exemplo n.º 5
0
        public ActionResult Create()
        {
            var model = new WorkNoticeModel();
            var name  = Session["User"] as User;

            model.Publisher      = name.UserName;
            ViewBag.Organization = TreeHtml.GetListOrganization();
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
Exemplo n.º 6
0
        public ActionResult Delete(Guid id)
        {
            WorkNoticeModel model = new WorkNoticeModel();
            var             info  = service.GetById(id);

            if (info != null)
            {
                info.IsDelete = true;
                service.UpdateGoogleProductRecord(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success, Message = "操作成功"
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Delete"), model));
        }