예제 #1
0
        public ActionResult GetByConditionPerPage(string ast_id, string ast_name, string ast_model,
                                                  string ast_std, string DepartmentID)
        {
            PropertyDTO property = new PropertyDTO();

            property.ast_id       = ast_id;
            property.ast_name     = ast_name;
            property.ast_model    = ast_model;
            property.ast_std      = ast_std;
            property.DepartmentID = DepartmentID;
            Property condition = PropertyDTOMapper.MapFromDTO(property);
            IList    list      = ManagerFactory.PropertyManager.GetByCondition(condition);

            List <PropertyDTO>          arr    = new List <PropertyDTO>();
            Dictionary <String, Object> result = new Dictionary <String, Object>();
            int sIndex   = this.Request["start"] == null ? 0 : int.Parse(this.Request["start"]);
            int pageSize = this.Request["limit"] == null ? list.Count : int.Parse(this.Request["limit"]);

            for (int i = 0; i < pageSize && (i + sIndex) < list.Count; i++)
            {
                arr.Add(PropertyDTOMapper.MapToDTO((Property)list[i + sIndex]));
            }
            result.Add("rows", arr);
            result.Add("total", list.Count);
            return(this.Json(result));
        }
예제 #2
0
        public ActionResult GetAll()
        {
            IList list = ManagerFactory.PropertyManager.GetAll();

            IList <PropertyDTO> result = new List <PropertyDTO>();

            foreach (Property o in list)
            {
                result.Add(PropertyDTOMapper.MapToDTO(o));
            }
            return(this.Json(result));
        }
예제 #3
0
        public ActionResult GetAllPerPage()
        {
            IList list = ManagerFactory.PropertyManager.GetAll();

            List <PropertyDTO>          arr    = new List <PropertyDTO>();
            Dictionary <String, Object> result = new Dictionary <String, Object>();
            int sIndex   = this.Request["start"] == null ? 0 : int.Parse(this.Request["start"]);
            int pageSize = this.Request["limit"] == null ? list.Count : int.Parse(this.Request["limit"]);

            for (int i = 0; i < pageSize && (i + sIndex) < list.Count; i++)
            {
                arr.Add(PropertyDTOMapper.MapToDTO((Property)list[i + sIndex]));
            }
            result.Add("rows", arr);
            result.Add("total", list.Count);
            return(this.Json(result));
        }
예제 #4
0
        public ActionResult GetProperty(string propertyId)
        {
            var         rdto     = new ResultDTO();
            Property    property = ManagerFactory.PropertyManager.GetProperty(propertyId);
            PropertyDTO dto      = PropertyDTOMapper.MapToDTO(property);

            if (property != null)
            {
                rdto.Message = "获取资产数据成功";
                rdto.Result  = true;
                rdto.Data    = dto;
            }
            else
            {
                rdto.Message = "获取资产数据失败";
                rdto.Result  = false;
            }
            return(this.Json(rdto));
        }