Skip to content

Commit 9d87f39

Browse files
committed
Events buggé
1 parent d45df54 commit 9d87f39

File tree

5 files changed

+29
-30
lines changed

5 files changed

+29
-30
lines changed

Zenergy/Zenergy/Pages/eventRegistration.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ <h2>{{dateSelected}}</h2>
1111
<tr>
1212
<th>Time</th>
1313
<th>Name</th>
14-
<th>Room</th>
15-
<th>Activity</th>
14+
<th>Description</th>
15+
<th>Duration</th>
1616
<th>Price</th>
1717
<th>Register</th>
1818
</tr>
1919
<tr ng-repeat="e in events">
2020
<td>{{e.timeBegin}}</td>
2121
<td>{{e.name}}</td>
22-
<td>{{e.roomName}}</td>
23-
<td>{{e.activity}}</td>
22+
<td>{{e.description}}</td>
23+
<td>{{e.duration}}</td>
2424
<td>{{e.price}}</td>
2525
<td> <button ng-click="joinEvent(e.Id)" class="btn btn-default" ng-if="!pastevent">Join</button></td>
2626

Zenergy/Zenergy/Pages/myevents.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ <h2>{{dateSelected}}</h2>
1111
<tr>
1212
<th>Time</th>
1313
<th>Name</th>
14-
<th>Room</th>
15-
<th>Activity</th>
14+
<th>Description</th>
15+
<th>Duration</th>
1616
<th>Price</th>
17-
<th>Register</th>
17+
<th>Register</th>
1818
</tr>
1919
<tr ng-repeat="e in events">
2020
<td>{{e.timeBegin}}</td>
2121
<td>{{e.name}}</td>
22-
<td>{{e.roomName}}</td>
23-
<td>{{e.activity}}</td>
22+
<td>{{e.description}}</td>
23+
<td>{{e.duration}}</td>
2424
<td>{{e.price}}</td>
2525
<td> <button ng-click="unjoinEvent(e.Id)" class="btn btn-default">Unjoin</button></td>
2626

Zenergy/Zenergy/Scripts/Controllers/eventRegistrationPageController.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ zenergyApp.controller("eventRegistrationPageController", ["$scope", "$http", "to
2222
$scope.getEvent = function () {
2323
$scope.events = [];
2424

25-
// var dateselected = new Date($scope.dateSelected).toJSON();
25+
var dateselected = new Date($scope.dateSelected).toJSON();
2626

2727
var responseEvent = $http({
28-
// url: '/api/events/bydate',
29-
url: '/api/ponctualEvents',
30-
method: 'GET',
31-
// data: { eventdate: dateselected },
28+
url: '/api/events/bydate',
29+
//url: '/api/ponctualEvents',
30+
method: 'POST',
31+
data: { eventdate: dateselected },
3232
headers: {
3333
'Content-Type': 'application/json'
3434
}
@@ -47,13 +47,11 @@ zenergyApp.controller("eventRegistrationPageController", ["$scope", "$http", "to
4747
for (var e in responseEvent.data) {
4848
$scope.events.push({
4949
Id: responseEvent.data[e].eventId,
50-
roomName: responseEvent.data[e].event.room.roomName,
51-
Description: responseEvent.data[e].event.eventDescription,
52-
timeBegin: responseEvent.data[e].event.timeBegin,
53-
duration: responseEvent.data[e].event.eventDurationHours,
54-
price: responseEvent.data[e].event.eventPrice,
55-
name: responseEvent.data[e].event.eventName,
56-
activity: responseEvent.data[e].event.activity.activityName
50+
description: responseEvent.data[e].eventDescription,
51+
timeBegin: responseEvent.data[e].timeBegin,
52+
duration: responseEvent.data[e].eventDurationHours,
53+
price: responseEvent.data[e].eventPrice,
54+
name: responseEvent.data[e].eventName,
5755
});
5856

5957
}

Zenergy/Zenergy/Scripts/Controllers/myEventsPagecontroller.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@
3838
}
3939
for (var e in responseEvent.data) {
4040

41-
var date = new Date(responseEvent.data[e].ponctualEvent.eventDate);
42-
date = date.getMonth() + 1 + "/" + date.getDate() + "/" + date.getFullYear();
41+
var date = responseEvent.data[e].ponctualEvent.eventDate;
42+
// date = date.getMonth() + 1 + "/" + date.getDate() + "/" + date.getFullYear();
43+
console.log(responseEvent.data[e].ponctualEvent.eventDate);
44+
var dateselected = new Date($scope.dateSelected).toJSON();
45+
console.log(dateselected);
4346

4447
// add this event to the list if it's current date
45-
if (date == $scope.dateSelected) {
48+
if (date == dateselected) {
4649
$scope.events.push({
4750
Id: responseEvent.data[e].eventId,
48-
roomName: responseEvent.data[e].room.roomName,
49-
Description: responseEvent.data[e].eventDescription,
51+
description: responseEvent.data[e].eventDescription,
5052
timeBegin: responseEvent.data[e].timeBegin,
5153
duration: responseEvent.data[e].eventDurationHours,
5254
price: responseEvent.data[e].eventPrice,
5355
name: responseEvent.data[e].eventName,
54-
activity: responseEvent.data[e].activity.activityName
5556
});
5657
}
5758
}
@@ -77,7 +78,7 @@
7778
};
7879

7980
$scope.getEvent();
80-
81+
// $scope.unjoinEvent(4);
8182

8283

8384
}]);

Zenergy/Zenergy/Web.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<connectionStrings>
1212
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-Zenergy-20151109023115.mdf;Initial Catalog=aspnet-Zenergy-20151109023115;Integrated Security=True" providerName="System.Data.SqlClient" />
1313
<!-- prod-->
14-
<add name="ZenergyContext" connectionString="metadata=res://*/Models.ZenergyModel.csdl|res://*/Models.ZenergyModel.ssdl|res://*/Models.ZenergyModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=zenergy.cb9xv2w6phgt.us-west-2.rds.amazonaws.com;initial catalog=zenergy;persist security info=True;user id=admin;password=zenergy1;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
14+
<!--<add name="ZenergyContext" connectionString="metadata=res://*/Models.ZenergyModel.csdl|res://*/Models.ZenergyModel.ssdl|res://*/Models.ZenergyModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=zenergy.cb9xv2w6phgt.us-west-2.rds.amazonaws.com;initial catalog=zenergy;persist security info=True;user id=admin;password=zenergy1;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />-->
1515

1616
<!-- test-->
17-
<!--<add name="ZenergyContext" connectionString="metadata=res://*/Models.ZenergyModel.csdl|res://*/Models.ZenergyModel.ssdl|res://*/Models.ZenergyModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=zenergy.cb9xv2w6phgt.us-west-2.rds.amazonaws.com;initial catalog=zenergyTest2;persist security info=True;user id=admin;password=zenergy1;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />-->
17+
<add name="ZenergyContext" connectionString="metadata=res://*/Models.ZenergyModel.csdl|res://*/Models.ZenergyModel.ssdl|res://*/Models.ZenergyModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=zenergy.cb9xv2w6phgt.us-west-2.rds.amazonaws.com;initial catalog=zenergyTest;persist security info=True;user id=admin;password=zenergy1;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
1818

1919
</connectionStrings>
2020
<appSettings></appSettings>

0 commit comments

Comments
 (0)