예제 #1
0
        public Stream GetEpHistoryChart(string date, string id)
        {
            long idYc = JsonConvert.DeserializeObject <Int32>(id);
            //DateTime settlementDate = JsonConvert.DeserializeObject<DateTime>(date);
            DateTime settlementDate = DateTime.ParseExact(date, "dd-MM-yyyy", CultureInfo.InvariantCulture);
            //settlementDate = Convert.ToDateTime(date);


            ResponseEntryPointHistory tmp = GetEntryPointHistoryList(settlementDate, idYc);
            //DataTable gdt = tmp.ToGoogleDataTable();

            string jsonStr = CEntryPointsToJson.ToChart(tmp);

            //System.Data.DataSet dataSet = new System.Data.DataSet("dataSet");
            //dataSet.Tables.Add(dt);
            //dataSet.AcceptChanges();

            WebOperationContext.Current.OutgoingResponse.ContentType =
                "application/json; charset=utf-8";
            return(new MemoryStream(Encoding.UTF8.GetBytes(jsonStr)));
        }
예제 #2
0
        public Stream GetEpHistoryGrid(string date, string id)
        {
            if (date == "-1" && id == "-1")
            {
                WebOperationContext.Current.OutgoingResponse.ContentType =
                    "application/json; charset=utf-8";
                return(new MemoryStream(Encoding.UTF8.GetBytes(CEntryPointsToJson.ToGrid(null))));
            }

            long idYc = JsonConvert.DeserializeObject <Int32>(id);
            //DateTime settlementDate = JsonConvert.DeserializeObject<DateTime>(date);
            DateTime settlementDate = Convert.ToDateTime(date);

            ResponseEntryPointHistory tmp = GetEntryPointHistoryList(settlementDate, idYc);

            string jsonStr = CEntryPointsToJson.ToGrid(tmp);

            WebOperationContext.Current.OutgoingResponse.ContentType =
                "application/json; charset=utf-8";
            return(new MemoryStream(Encoding.UTF8.GetBytes(jsonStr)));
        }