public JsonResult AddArea(Area area)
 {
     AjaxResult result = new AjaxResult();
     dynamic a = new AreaRule().AddArea(area);
     result.Success = a.Errormsg != null ? false : true;
     result.Message = result.Success ? "地区信息添加成功" : "error:" + a.Errormsg;
     return Json(result, JsonRequestBehavior.AllowGet);
 }
 public JsonResult AnalysisAreaCharge(string pID, string beginDate, string endDate)
 {
     List<dynamic> areaAnalysisList = new AreaRule().AreaChargeAnalysis(pID, beginDate, endDate);
     var showList = from areaAnalysis in areaAnalysisList
                    select new
                    {
                        name = areaAnalysis.NAME,
                        y = Convert.ToDouble(areaAnalysis.FEECOUNT)
                    };
     return Json(showList, JsonRequestBehavior.AllowGet);
 }
 public ActionResult Query()
 {
     //地区选择绑定
     AreaRule area = new AreaRule();
     ViewBag.area = area.GetAllList();
     return View();
 }
 public JsonResult GetAllAreaJson()
 {
     List<dynamic> list = new AreaRule().GetTreeGridList();
     List<Object> result = new List<object>();
     foreach (dynamic a in list)
     {
         if (string.IsNullOrEmpty(a.PID))
         {
             result.Add(new { Identifier = a.ID, Area_Name = a.NAME, Manager = a.MANAGER, ManagerName = a.MANAGERNAME });
         }
         else
         {
             result.Add(new { Identifier = a.ID, Area_Name = a.NAME, _parentId = a.PID, Manager = a.MANAGER, ManagerName = a.MANAGERNAME });
         }
     }
     Dictionary<string, object> json = new Dictionary<string, object>();
     json.Add("total", list.Count);
     json.Add("rows", result);
     return Json(json, JsonRequestBehavior.AllowGet);
 }