Commit Graph

233 Commits

Author SHA1 Message Date
21f87c9558 removed braces.
added logging for when the selectedDate parameter is null (for current week).

#9
2017-02-14 17:07:07 +00:00
69aaf53bb4 Added method to calculate the daily logs.
extended TimeLogList object:
 > to group logs into days with the "DailyLogs" object
 > to calculate the WeeklyTotal hours automatically based on the TimeLogs.DailyLogs object for each day.

Created DailyLogs object:
 > holds the number of entries for a day.
 > holds the time "in"/"at work" for that day (dailytotal).

#15
2017-02-14 17:06:16 +00:00
eb1ba4157a fixed log formatting.
#9
2017-02-14 16:31:44 +00:00
a2cb93bf83 fixup! add foreach to group logs by the day of the week in which they are entered. #15 2017-02-14 14:04:03 +00:00
906ec10a5b fixed issue where GetLogDirection would return the first log of the day, not the latest in the DB.
fixed issue where clicking timepicker would return an absolute, incorrect url.
2017-02-13 22:23:21 +00:00
0b310f29f3 removed all page size, unsure how implementation will work in reality.
#11
2017-02-13 21:12:37 +00:00
36282ee355 added some logging to SQLiteRepository.
#9
2017-02-13 16:57:18 +00:00
00a6894197 added trace logging to the controller classes.
changed nlog config file to output trace logging.
#9
2017-02-13 14:07:09 +00:00
923e4473a9 formatting changes. corrected pagination options at the bottom of users page to be aligned correctly, both horizontally and vertically.
#11
2017-02-13 11:48:57 +00:00
cdac61b18d added pagination to the repository GetUser method.
added pagesixe to userlist object.
added total user count to enable PageCount to work correctly.
added GET_TOTAL_USER_COUNT and GET_ALL_USERS_PAGINATE sqlite procedures to support pagination.
updated methods in SQLiteRepository to support pagination procedures and pagination properties of UserList.
updated UsersController to support pagination parameters.
tidied html script tags.
added pagination buttons at the bottom of user page. including drop down to select PageSize
added setPageSize, goToUserPage and setPagination methods to the viewmodel.
updated other methods for sammy etc to work with pagesize and PageNumber params.
#11
2017-02-12 22:26:00 +00:00
159c0a7625 added postbuild event steps to copy dependencies into the output directory. 2017-02-10 22:42:05 +00:00
24ba9480e9 changed Configuration to bind ninject assemblies from xml file using Ninject.Extentions.Xml
ninject will load DefaultLogger if no logger is found. if no IRepository is found, will exception.
created DefaultLogger which will just log to Debug.WriteLine
#5
2017-02-10 22:40:18 +00:00
f73fb9d345 renamed Class1 to NLogger.cs.
implemented ILogger interface for NLog logger.
added Chainsaw NLogConfig.xml file.
#9
2017-02-10 22:37:57 +00:00
fd015f1070 remove debugging code. tidy code up. 2017-02-10 17:15:28 +00:00
d237c6c00d remove unnecessary code from development.
#5
2017-02-10 17:12:20 +00:00
f1794a2e56 project/sln updates. 2017-02-10 16:56:10 +00:00
d2035a776d fixed selected date for the datepicker. will now highlight the selected date that it is showing time logs for.
#5
2017-02-10 16:55:58 +00:00
8fb6fedc7d updated references to pull in required packages. 2017-02-10 16:54:21 +00:00
5be05ecd5e changed datetime properties to return just the date, ignore the time. 2017-02-10 16:53:44 +00:00
fd257c7bca added missing sqlite nuget package for sqlite interop dlls. 2017-02-10 16:53:16 +00:00
fca8b59c3e merge in Card Reader Service and Service host projects. 2017-02-10 15:59:37 +00:00
832426608c assign to selectedDate even if date is not supplied.
update initDatePicker to accept date. This date will be the setDate argument for bootstrap datepicker.
error is here, its not assigning the date correctly for the picker.
#5
2017-02-10 12:43:23 +00:00
19b718a946 changed IRepository to accept a DateTime for the arg, instead of an int for calendar week/year.
added SelectedDate to the TimeLog object.
changed the timelog controller to accept a datetime as an arg, instead of the previous calendarweek/year args.
This kills two birds with one arg.
Changed the goToTimeLogs function to accept an args object to allow passing of datetime SelectedDate parameter.
removed console.logs to tidy code a little.
corrected some "undefined" parameter bugs/errors.
#5
2017-02-10 12:07:02 +00:00
ced578e05d added wix installer stub project.
#7
2017-02-09 22:28:21 +00:00
7923867c2d hook into the selected week changed event to get timelogs from the api.
needs to change the datetime picker to show the selected date rather than today date.
#5
2017-02-09 22:13:45 +00:00
760f37b14b added manuallog object to allow users to create a sign in/out log for the swipedatacontroller log. 2017-02-09 21:36:22 +00:00
38fab21afd renamed TimeLogDB to TimeLogDb.
moved LogDirectionDB to its own file and renamed to LogDirectionDb
2017-02-09 21:33:52 +00:00
150a9a8d70 Add Error message generation to the UI.
#10
2017-02-09 21:27:20 +00:00
666975b2ec added NLog Logger stub project to implement the logger. #9 2017-02-09 16:30:50 +00:00
e3207fa684 proj update for ILogger interface. 2017-02-09 16:30:01 +00:00
b3a8530bf1 added ILogger interface to support a logging output for errors etc.
gitlab issue: #9
2017-02-09 16:26:42 +00:00
db15f01677 created assignErrorObject method to make raising an error much easier.
no error handling implemented yet.
2017-02-08 22:27:43 +00:00
34b427293a return the new Id of the created time log event.
tidied code too.
2017-02-08 22:26:33 +00:00
526aca3d58 TimelogController now pulls in the Repository interface.
Implemented the GetTimeLogs method to get the proper time logs from the DB.
2017-02-08 22:25:21 +00:00
24d35d24d2 use nameof compiler method to prevent the SQLiteProcedures constants needing to be rewritten and being too hard-coded. 2017-02-08 22:23:45 +00:00
34665985a5 added TimeLogCount 2017-02-08 22:22:49 +00:00
0867cbd7a6 implemented the GetTimeLogs methods.
re-referenced TimeLog to TimeLogDB
implemented the LogEventTime method, now logs direction user was going.
also logs the CalendarWeek and Year, returns the Id of the time log entry now too.
2017-02-08 22:22:36 +00:00
3d64fc90ff created enum for LogDirection (in, out or unknown) added extra parameters to TimeLog to provide sufficient data on the log event.
renamed TimeLog to TimeLogDb, to create a database Entity.
2017-02-08 22:19:58 +00:00
e2859f12f8 added out param to return created time log id. 2017-02-08 22:14:12 +00:00
54d11ddf9d added stub/comment for manual swipe data log submission.
returned user id in user edit
started working on the direction/logtime method
2017-02-08 16:51:23 +00:00
56fa9c60b0 Project update to include the CacheControlAttribute file. 2017-02-07 17:25:55 +00:00
13868a2655 added cache attribute tags, set expiry to 0seconds on all API endpoints. 2017-02-07 17:25:39 +00:00
50acc1b136 Added Cache Attribute to stop IE caching data. 2017-02-07 17:25:07 +00:00
992f5cd1f4 added footer CSS.
added dismissAlert method to clear error data.
added error data object.
tidying code a bit.
Added Error handling UI elements to the html page.
2017-02-07 17:24:34 +00:00
ea6fc3721d fixed update/create where HoursPerWeek/IsContractor info wasnt being updated/changed.
return UserId using the Out Parameter
Added GetLastTimeLog procedure. Added Comments to help figure out procedure steps later on.
2017-02-07 17:23:04 +00:00
29cc798097 added out param to IRepository to return the UserId of the user that has been created/updated. 2017-02-07 17:20:37 +00:00
83cef61519 Implemented some proper stubbing out method to return the defined object for testing.
Time logs yet to be fully implemented.
2017-02-06 22:18:37 +00:00
0bb6c8bc08 corrected uiPages method to return correct home endpoint.
changed references to User.Id to User.UserId.
added relativePath option to createRequestUrl(..).
added documentation to returnButtonClick and createRequestUrl methods.
changed initDatePicker to have separate assign handler method to make code simpler.
changed all URL references to relative urls, no longer JSONP/crossdomain compatible.
tidied code.
added query parameter to home/users page.
added search getJson method.
changed all property names to match the WebApi endpoint.
added js to conditionally highlight the datepicker row on hover.
changed script and css references to proper CDN urls.
tidied html.
added form for querying user list.
UserController will conditionally choose to GetUsersList or Search, based on Query Parameter.
Add search method to IRepository
Implement Search method on IRepository interface
added search procedure to SQLiteProcedures
added Query property to UserList to allow UI to display the last filter/query parameter.
2017-02-06 22:18:09 +00:00
c9ac6f25d5 added row highlight class for bootstrap datepicker. 2017-02-06 22:08:45 +00:00
e60c1f55bb add TimeLog initialiser. 2017-02-06 22:05:50 +00:00
7596eb7d3f #4 Added IsContractor flag to the UserIdentity and User Object, the Api will now relate that status to the output object. note, notimplemented in the UI yet to control this flag. 2017-02-03 12:39:38 +00:00
93ec0987f4 project update to include new files etc. 2017-02-03 12:22:22 +00:00
39d7bc6cc4 added TimelogController. 2017-02-03 12:22:08 +00:00
532bf2b105 Moved CardsController, SwipeDataController, UsersController, ValuesController to a "Controllers" dir. 2017-02-03 12:21:54 +00:00
4ac6b2475b Added initialisation for User object to set First and Last names to an empty string.
removed line to check if user id is valid, as when creating a user id, it will be -1....
2017-02-03 12:21:21 +00:00
86a1618819 corrected binding for Id to look at UserId field. 2017-02-03 12:20:26 +00:00
9309d9bbf4 added favicon 2017-02-03 08:36:16 +00:00
384ae45c63 pulled out endpoints into single object, instead of having the strings in file.
all strings now use double quotes.
all url generation now handled by createRequestUrl, instead of string concatenation in methods.
errors in getJson methods will now redirect home, suggest implementing proper error message or something...
removed unnecessary console.log's
2017-02-02 17:03:50 +00:00
d02862a5f8 change endpoint to start on all ip addresses. 2017-02-02 17:00:45 +00:00
974ffe4b13 updated html/js/css to latest codepen code. will out of box point to the json-server endpoint. needs to be modified to work with the datacenter api 2017-02-01 21:10:38 +00:00
fa3a115c5c Finalized the merge..
Merge remote-tracking branch 'origin/CreateStaticFileHost' into UnbrokenSQLiteImplementation

# Conflicts:
#	DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/App.config
#	DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Service1.cs
#	DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj
#	DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/packages.config
#	DataCenter_Windows/WindowsDataCenter/WindowsDataServiceHost/App.config
#	DataCenter_Windows/WindowsDataCenter/WindowsDataServiceHost/packages.config
2017-02-01 20:28:42 +00:00
3fe792d36c manually merging static files etc from branch, this way i can make sure it still works.. seems to be some package going belly up with its dependencies.. no idea what. 2017-02-01 20:05:30 +00:00
f96078f2ca add the missing file references from adding DalSoft and Owin Static Files...
stupid visual studio, stupid operator.
2017-02-01 19:54:19 +00:00
ff20c6abdf added static files owin host and dalsoft webapi help pages package manually to merge in branch. (preventing app from running after merge otherwise, no idea why) 2017-02-01 19:46:17 +00:00
de57353511 added come comments to explain setup and configuration of ninject and WebAPI. 2017-01-31 22:10:36 +00:00
1e8d56ab82 csproj update to reference Interfaces and SQLiteRepository implementation.
Complete IRepository migration into the ApiControllers.
remove any nuget packages from the packages.config which refer to sqlite and entity framework.
missing csproj update for SQLiteRepository project. Sorry..
2017-01-31 22:09:40 +00:00
dd8d91279f moved Configuration class to its own file. 2017-01-31 22:01:42 +00:00
8585f0fe77 moved NinjectDependencyResolver, NinjectDependencyScope and NinjectHelper to their own files 2017-01-31 22:00:40 +00:00
bc1947a31f Move the database calls/procedures out into the SQLiteRepository, IRepository implementation.
created SQLiteProcedures to hold all the strings for procs. Constants also serves similar purpose.
renamed Class1 to SQLiteRepository.cs
added all the necessary nuget packages for SQLite.Net-PCL
2017-01-31 21:59:42 +00:00
440c1f44ce Added IRepository comments.
Changed oder of response codes.
changed HoursPerWeek to use float not int.
Changed AssociatedIdentifierCount to use count property on AssociatedIdentifiers instead of needing to populate separately.
Changed UserCount in UserList for the same reason.
Added Users list initialisation to prevent null ref exception.
overrode Equals and GetHashCode to allow use of List.Except method. (tests show without this, Except is useless).
2017-01-31 21:57:21 +00:00
a0d050acd2 Created the SQLiteRepository stub. ready for implementation..
(move to Ninject/Dependency Injection model)
2017-01-31 17:25:01 +00:00
1ad53fbe76 Added Interfaces project which holds everything required for the IRepository Interface 2017-01-31 17:24:16 +00:00
a7d23d9e7c Added Ninject and ninject resolvers to enable dependency inject on the ApiController Classes. 2017-01-30 22:39:34 +00:00
a892e1d2c8 suspect service1 file incomplete due to selected line commits.
Added sqlite references.
added new CardsController, SwipeDataController and UsersController classes which all pull in SQLite to retrieve, or store their data.
2017-01-30 22:38:49 +00:00
3579f750cc moved ValuesController to its own class, remove UsersController and SwipeDataController classes, pending sqlite implementation. 2017-01-30 22:34:25 +00:00
bc3c7a5e31 moved owin config to its own file,
removed predefined route definition in favour of mapping attributes on ApiController classes.
Added JsonpFormatter to ensure cross-domain api web requests will work to this API.
added formatter to HTTPConfiguration for owin config.
2017-01-30 22:30:58 +00:00
10027d7f22 added sqlite dependency 2017-01-30 22:28:20 +00:00
c7424d806b added sqlite third party dependencies. 2017-01-30 22:27:43 +00:00
eca081f63d added extra method documentation to a dummy controller method to test out the dalsoft package.
removed "RouteController" - redundant now with dalsoft nuget package.
2017-01-30 20:25:18 +00:00
532ed16bbd Added package DalSoft.WebApi.HelpPage which will create help pages for every ApiController in the solution. 2017-01-29 16:09:26 +00:00
fba15b89f3 changed to reference cdn bootstrap (as it does on codepen.io demo/test page). 2017-01-29 15:44:59 +00:00
430f91ce18 add package Microsoft.Owin.StaticFiles.
added www folder to project, with bootstrap css/js files.
added the main single page app files to the project, pulled from codepen.io test/demo pages.
set properties to copy always for the main app files, bootstrap stuff is copy if newer.
added filesystem options to the StartOwin method.
2017-01-29 15:24:23 +00:00
e5ce621827 Initial commit of Windows Service DataCenter variant (pulling code from the RPi variant). 2017-01-26 16:45:04 +00:00