Ejemplo n.º 1
0
 public ActionResult Create(TipsForConvenienceModel model)
 {
     if (ModelState.IsValid)
     {
         service.Add(Mapper.Map <TipsForConvenienceModel, TipsForConvenienceInfo>(model));
         return(Json(new AjaxResult()
         {
             Result = Result.Success, Message = "操作成功"
         }));
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
Ejemplo n.º 2
0
        public ActionResult Delete(Guid id)
        {
            TipsForConvenienceModel model = new TipsForConvenienceModel();
            var info = service.GetById(id);

            if (info != null)
            {
                info.IsDelete = true;
                service.Update(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success, Message = "操作成功"
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Delete"), model));
        }
Ejemplo n.º 3
0
 public ActionResult Edit(TipsForConvenienceModel model)
 {
     if (ModelState.IsValid)
     {
         var info = service.GetById(model.Id);
         if (info != null)
         {
             //info = Mapper.Map<TipsForConvenienceModel, TipsForConvenience>(model);
             info.Title      = model.Title;
             info.Content    = model.Content;
             info.UpdateDate = DateTime.Now;
             service.Update(info);
             return(Json(new AjaxResult()
             {
                 Result = Result.Success, Message = "操作成功"
             }));
         }
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
 }
Ejemplo n.º 4
0
        public ActionResult Create()
        {
            var model = new TipsForConvenienceModel();

            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }