protected void btnSubmit_Click(object sender, EventArgs e) { Model.Map u = new Model.Map { Map_Site = this.txtSite.Text.Trim(), Map_Phone = this.txtPhone.Text.Trim() }; var res = MapSvc.Add(u); ReturnMsg rm = res > 0 ? new ReturnMsg() { Code = StatusCode.OK, Message = "新增用户信息成功", Data = null } : new ReturnMsg() { Code = StatusCode.Error, Message = "新增用户信息失败", Data = null }; Session["Msg"] = rm; //用于传递执行信息的 Response.Redirect("Map_List.aspx"); }
public JsonResult AddMap(MapItem MapItem) { service.Add(new LocationMap { LocationMapName = MapItem.Name, Latitude = MapItem.Lat, Longitude = MapItem.Long, LocationMapImageUrl = MapItem.Url }); return(Json("success")); }