public ActionResult Create(Region region) { string strResult = string.Empty; bool bResult = RegionService.Add(region); string msg = bResult ? "新增成功" : "新增失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, null), "text", JsonRequestBehavior.AllowGet); }
// // GET: /Region/Details/ public ActionResult Details(int page, int rows, FormCollection collection) { Region reg = new Region(); reg.RegionName = collection["RegionName"] ?? ""; reg.State = collection["State"] ?? ""; var regDetail = RegionService.GetDetails(page, rows, reg); return Json(regDetail, "text", JsonRequestBehavior.AllowGet); }
// /SRM/CreateExcelToClient/ public FileStreamResult CreateExcelToClient() { int page = 0, rows = 0; int RegionID = Convert.ToInt32(Request.QueryString["ID"]); string RegionName = Request.QueryString["RegionName"]; string Description = Request.QueryString["Description"]; string State = Request.QueryString["State"]; Region region = new Region(); region.ID = RegionID; region.RegionName = RegionName; region.Description = Description; region.State = State; ExportParam ep = new ExportParam(); ep.DT1 = RegionService.GetRegion(page, rows, region); ep.HeadTitle1 = "区域信息"; return PrintService.Print(ep); }
// // POST: /Region/Edit/5 public ActionResult Edit(Region region) { string strResult = string.Empty; bool bResult = RegionService.Save(region); string msg = bResult ? "修改成功" : "修改失败"; return Json(JsonMessageHelper.getJsonMessage(bResult, msg, strResult), "text", JsonRequestBehavior.AllowGet); }