I am currently developing an event calendar using ASP.NET / C# with SQL Server. It is part of a CMS project I am working on and will be publishing the project next year. I have been working on this calendar for 2 months now. It is turning out to be a big project. I was able to use ASP.NET calendar control for the main calendar but for different views like week, day, and list view, I had to implement my own solutions. PM me for more details.
I would also suggest you use the google calendar. It works just fine and you can easily incorporate it into a site. The other suggestion is that you buy a system. my brother uses supersaas.com, and he is very happy with the way it works. but then you got to pay for it.
If its any help - We used a Task running in the background to read Google Calander using the API then store in a table - You need to setup the API and get the data from Google Calander and store in settings Later displayed the table data using FullCalander https://fullcalendar.io/ It also has a link to store enteries into Google Calander https://fullcalendar.io/releases/fullcalendar/3.9.0/demos/gcal.html
//** Some old Code from V1.7 **/
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Web; using System.Security.Cryptography.X509Certificates; using Google.Apis.Authentication.OAuth2; using Google.Apis.Authentication.OAuth2.DotNetOpenAuth; using Google.Apis.Calendar.v3; using Google.Apis.Util;
namespace NopSolutions.NopCommerce.BusinessLogic.Google { public static class GoogleCalendar { #region Methods
public static void ReplicateCalendar() { string eventName = null;
string calendarId = "GoogleCalanderName";
var googleEvents = Replicate(calendarId); if(!googleEvents.Any()) return;
foreach (var i in googleEvents) { eventName = i.Name; if (i.Start > DateTime.Now) { bool deleted = !(!i.Deleted && i.Busy);
// Do Something with the calendar data
} } }
#endregion
#region Utils
private static IEnumerable<GoogleCalendarEvent> Replicate(string calendarId) { if(String.IsNullOrWhiteSpace(calendarId)) throw new ArgumentNullException("calendarId");
var certificate = new X509Certificate2(serviceCertificatePath, clientSecret, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); var provider = new AssertionFlowClient(GoogleAuthenticationServer.Description, certificate) { ServiceAccountId = serviceAccountUser, Scope = CalendarService.Scopes.CalendarReadonly.GetStringValue() }; var authenticator = new OAuth2Authenticator<AssertionFlowClient>(provider, AssertionFlowClient.GetState); var service = new CalendarService(authenticator) { Key = key }; var req = new EventsResource.ListRequest(service, calendarId) { ShowDeleted = true, TimeMin = DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", CultureInfo.InvariantCulture), MaxResults = Int32.MaxValue, SingleEvents = true, }; var rsp = req.Fetch(); if(rsp.Items == null || !rsp.Items.Any()) return Enumerable.Empty<GoogleCalendarEvent>();
return rsp.Items.Select(x => new GoogleCalendarEvent { Id = EnsureNotNull(x.Id), Name = EnsureNotNull(x.Summary), Description = EnsureNotNull(x.Description), Start = DateTime.Parse(String.IsNullOrWhiteSpace(x.Start.DateTime) ? x.Start.Date : x.Start.DateTime), End = DateTime.Parse(String.IsNullOrWhiteSpace(x.End.DateTime) ? x.Start.Date : x.End.DateTime), // If end time is null event is all day but save end date as start date Busy = !EnsureNotNull(x.Transparency).Equals("transparent", StringComparison.InvariantCultureIgnoreCase), Deleted = x.Status.Equals("cancelled", StringComparison.InvariantCultureIgnoreCase) }).ToList(); }
If its any help - We used a Task running in the background to read Google Calander using the API then store in a table - You need to setup the API and get the data from Google Calander and store in settings Later displayed the table data using FullCalander https://fullcalendar.io/ It also has a link to store enteries into Google Calander https://fullcalendar.io/releases/fullcalendar/3.9.0/demos/gcal.html
//** Some old Code from V1.7 **/
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Web; using System.Security.Cryptography.X509Certificates; using Google.Apis.Authentication.OAuth2; using Google.Apis.Authentication.OAuth2.DotNetOpenAuth; using Google.Apis.Calendar.v3; using Google.Apis.Util;
namespace NopSolutions.NopCommerce.BusinessLogic.Google { public static class GoogleCalendar { #region Methods
public static void ReplicateCalendar() { string eventName = null;
string calendarId = "GoogleCalanderName";
var googleEvents = Replicate(calendarId); if(!googleEvents.Any()) return;
foreach (var i in googleEvents) { eventName = i.Name; if (i.Start > DateTime.Now) { bool deleted = !(!i.Deleted && i.Busy);
// Do Something with the calendar data
} } }
#endregion
#region Utils
private static IEnumerable<GoogleCalendarEvent> Replicate(string calendarId) { if(String.IsNullOrWhiteSpace(calendarId)) throw new ArgumentNullException("calendarId");
var certificate = new X509Certificate2(serviceCertificatePath, clientSecret, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); var provider = new AssertionFlowClient(GoogleAuthenticationServer.Description, certificate) { ServiceAccountId = serviceAccountUser, Scope = CalendarService.Scopes.CalendarReadonly.GetStringValue() }; var authenticator = new OAuth2Authenticator<AssertionFlowClient>(provider, AssertionFlowClient.GetState); var service = new CalendarService(authenticator) { Key = key }; var req = new EventsResource.ListRequest(service, calendarId) { ShowDeleted = true, TimeMin = DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", CultureInfo.InvariantCulture), MaxResults = Int32.MaxValue, SingleEvents = true, }; var rsp = req.Fetch(); if(rsp.Items == null || !rsp.Items.Any()) return Enumerable.Empty<GoogleCalendarEvent>();
return rsp.Items.Select(x => new GoogleCalendarEvent { Id = EnsureNotNull(x.Id), Name = EnsureNotNull(x.Summary), Description = EnsureNotNull(x.Description), Start = DateTime.Parse(String.IsNullOrWhiteSpace(x.Start.DateTime) ? x.Start.Date : x.Start.DateTime), End = DateTime.Parse(String.IsNullOrWhiteSpace(x.End.DateTime) ? x.Start.Date : x.End.DateTime), // If end time is null event is all day but save end date as start date Busy = !EnsureNotNull(x.Transparency).Equals("transparent", StringComparison.InvariantCultureIgnoreCase), Deleted = x.Status.Equals("cancelled", StringComparison.InvariantCultureIgnoreCase) }).ToList(); }
Still not sure what you want to do? But you (or someone else) is going to need to be doing some developing - the code above can be used in a copy of a task routine for example QueuedMessagesSendTask and used to read from Google Calander in the background. Then you need a new table to store the events from Google.
To display the data these guys have implemented Full Calander on a page see http://demo.nopcommerce.pl/eventCalendar Maybe whatever else they have done would be useful.