コード例 #1
0
        public void Export()
        {
            ISyscodeService syscodeService = UnityHelper.UnityResolve <ISyscodeService>();
            QueryEntity     qe             = InitQueryEntity();

            qe.IsGetAll = true;
            var data = syscodeService.GetSyscodeByQueryList(qe);

            Export2Excel("Syscode.xls", data);
        }
コード例 #2
0
        public string GetAllSyscode()
        {
            ISyscodeService tmpService = UnityHelper.UnityResolve <ISyscodeService>();
            var             data       = tmpService.GetSyscodeByQueryList(InitQueryEntity());

            Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
            timeConverter.DateTimeFormat = ConstUtils.CONST_SHOW_DATE_FORMAT;
            var tmpdata = JsonConvert.SerializeObject(data.Tables[2], timeConverter);
            var result  = "{\"total\":" + data.Tables[1].Rows[0]["TotalRecordsCount"].ToString() + ",\"rows\":" + tmpdata + " }";

            return(result);
        }