Hi,
I have a problem with the chart component.
I have a wcf service for retrieving data for the kendo ui chart.
I just would like to transfer two parameters by using the line ;
data: '{BasTar:"2011-01-01",SonTar:"2011-12-31"}'
and my service side is
in IProductService.cs
and in ProductService.svc.cs
public IList<ModelIlBazliAnaliz> jIlBazliAnaliz(DateTime BasTar, DateTime SonTar)
{
IList<ModelIlBazliAnaliz> Iller=new List<ModelIlBazliAnaliz>();
using (mxKalibrasyonEntities client = new mxKalibrasyonEntities())
{
var bak = client.kal_IlBazliAnaliz(BasTar, SonTar).ToList();
foreach (var kalIlBazliAnalizResult in bak)
{
Iller.Add(new ModelIlBazliAnaliz
{
Sayi = kalIlBazliAnalizResult.Sayi.Value,
Oran = kalIlBazliAnalizResult.Oran.Value,
IlAdi = kalIlBazliAnalizResult.IlAdi
});
}
return Iller;
}
}
The issue is I am getting always null (0001-01-01) date value in the ProductService.svc.cs .
If ı don't use any parameters, I mean with the
public IList<ModelIlBazliAnaliz> jIlBazliAnaliz() ;
without any parameters , my chart works great. But it is an obligation to have the chart filled for some time intervals.
I wonder how can I send the BasTar and SonTar datetime parameters to the wcf service? I think this is possible.
Kind regards.
Inanc
I have a problem with the chart component.
I have a wcf service for retrieving data for the kendo ui chart.
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
$("#chart").kendoChart({
dataSource: {
transport: {
read: {
type:"post",
url:"http://localhost:1038/Services/ProductService.svc/jIlBazliAnaliz",
dataType: "json",
data: '{BasTar:"2011-01-01",SonTar:"2011-12-31"}'
}
}
},
seriesDefaults: {
type: "column"
},
series: [{
field: "Sayi",
name: "Sayi"
}],
categoryAxis: {
field: "IlAdi",
labels: {
rotation:-90
}
}
});
});
</
script
>
I just would like to transfer two parameters by using the line ;
data: '{BasTar:"2011-01-01",SonTar:"2011-12-31"}'
and my service side is
in IProductService.cs
[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "jIlBazliAnaliz")]
IList<
ModelIlBazliAnaliz
> jIlBazliAnaliz(DateTime BasTar, DateTime SonTar);
{
IList<ModelIlBazliAnaliz> Iller=new List<ModelIlBazliAnaliz>();
using (mxKalibrasyonEntities client = new mxKalibrasyonEntities())
{
var bak = client.kal_IlBazliAnaliz(BasTar, SonTar).ToList();
foreach (var kalIlBazliAnalizResult in bak)
{
Iller.Add(new ModelIlBazliAnaliz
{
Sayi = kalIlBazliAnalizResult.Sayi.Value,
Oran = kalIlBazliAnalizResult.Oran.Value,
IlAdi = kalIlBazliAnalizResult.IlAdi
});
}
return Iller;
}
}
The issue is I am getting always null (0001-01-01) date value in the ProductService.svc.cs .
If ı don't use any parameters, I mean with the
public IList<ModelIlBazliAnaliz> jIlBazliAnaliz() ;
without any parameters , my chart works great. But it is an obligation to have the chart filled for some time intervals.
I wonder how can I send the BasTar and SonTar datetime parameters to the wcf service? I think this is possible.
Kind regards.
Inanc