public ActionResult Edit(MapMessageModel model) { if (ModelState.IsValid) { var info = service.GetById(model.Id); if (info != null) { //info = Mapper.Map<MapMessageModel, MapMessageInfo>(model); info.Name = model.Name; info.RegisterOrganization = model.RegisterOrganization; info.SortModual = model.SortModual; info.SortType = model.SortType; info.lat = model.lat; info.lng = model.lng; info.Address = model.Address; service.Update(info); return(Json(new AjaxResult() { Result = Result.Success, Message = "操作成功" })); } } return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model)); }
public ActionResult Create(MapMessageModel model) { if (ModelState.IsValid) { service.Add(Mapper.Map <MapMessageModel, MapMessageInfo>(model)); return(Json(new AjaxResult() { Result = Result.Success, Message = "操作成功" })); } return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }
public ActionResult Delete(Guid id) { MapMessageModel model = new MapMessageModel(); 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)); }
public ActionResult Create() { var model = new MapMessageModel(); return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }