using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Yavsc.Admin;
using Yavsc.Model.Calendar;
using Yavsc.Model.Circles;
using System.Web.Security;
using Yavsc.Model.Google.Api;
namespace Yavsc.Controllers
{
///
/// Back office controller.
///
public class BackOfficeController : Controller
{
///
/// Index this instance.
///
[Authorize(Roles="Admin,Providers")]
public ActionResult Index()
{
return View ();
}
///
/// Notifies the event.
///
/// The event.
/// Evpub.
public ActionResult NotifyEvent(EventCirclesPub evpub)
{
if (ModelState.IsValid) {
ViewData ["NotifyEvent"] = evpub;
return View ("NotifyEventResponse", GoogleHelpers.NotifyEvent (evpub));
}
ViewData["CircleIds"] = CircleManager.DefaultProvider.List (
Membership.GetUser ().UserName).Select (x => new SelectListItem {
Value = x.Id.ToString(),
Text = x.Title,
Selected = (evpub.CircleIds==null) ? false : evpub.CircleIds.Contains (x.Id)
});
return View (evpub);
}
}
}