public ActionResult GetDepartment(string DepartmentID,string DepartmentName,string ParentDepartmentId)
        {
            IList<DepartmentDTO> result = new List<DepartmentDTO>();
            DepartmentDTO Depart = new DepartmentDTO();
            Depart.DepartmentID = DepartmentID;
            Depart.DepartmentName = DepartmentName;
            Depart.ParentDepartmentId = ParentDepartmentId;
            Model.Department dep = DepartmentDTOMapper.MapFromDTO(Depart);

            IList list= ManagerFactory.DepartmentManager.GetByCondition (dep);
            int sIndex = int.Parse(this.Request.Params["start"] == null ? "0" : this.Request.Params["start"]);
            int pageSize = int.Parse(this.Request.Params["limit"] == null ? list.Count.ToString() : this.Request.Params["limit"]);
            for (int i = 0; i < pageSize && (sIndex + i) < list.Count; i++)
            {
                Department obj = (Department)list[sIndex + i];
                result.Add(DepartmentDTOMapper.MapToDTO(obj));
            }
            //  组装返回结果
            Dictionary<String, Object> resultMap = new Dictionary<String, Object>();
            //  记录条数
            resultMap.Add("total", list.Count);
            //  root
            resultMap.Add("root", result);
            return this.Json(resultMap);
        }
        public ActionResult AddDepart(DepartmentDTO  Depart)
        {
            var rdto = new ResultDTO();
            Model.Department  dep = DepartmentDTOMapper .MapFromDTO(Depart);

            try
            {
                ManagerFactory.DepartmentManager.SaveDepartment(dep);
                rdto.Message = "登录成功";
                rdto.Result = true;
            }
            catch (Exception ex)
            {
                rdto.Message = "登录失败:" + ex.Message ;
                rdto.Result = false;
            }

            return this.Json(rdto);
        }
        public ActionResult UpdateDepart(DepartmentDTO Depart)
        {
            var rdto = new ResultDTO();
            Model.Department dep = DepartmentDTOMapper.MapFromDTO(Depart);

            try
            {
                ManagerFactory.DepartmentManager.UpdateDepartment(dep);
                rdto.Message = "更新成功";
                rdto.Result = true;
            }
            catch
            {
                rdto.Message = "更新失败";
                rdto.Result = false;
            }
            return this.Json(rdto);
        }