Esempio n. 1
0
        public void Export()
        {
            IItemclassService itemclassService = UnityHelper.UnityResolve <IItemclassService>();
            QueryEntity       qe = InitQueryEntity();

            qe.IsGetAll = true;
            var data = itemclassService.GetItemclassByQueryList(qe);

            Export2Excel("Itemclass.xls", data);
        }
Esempio n. 2
0
        public string GetAllItemclass()
        {
            IItemclassService tmpService = UnityHelper.UnityResolve <IItemclassService>();
            var data = tmpService.GetItemclassByQueryList(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);
        }