Example #1
0
 public ActionResult Create(Guid ResellerID)
 {
     if (HasPermission("Add Client"))
     {
         if (ResellerService.QuotaFull(ResellerID))
         {
             TempData["QuotaFull"] = "Your Clients Quota is full";
             return(RedirectToAction("Index", new { ResellerID = ResellerID }));
         }
         else
         {
             TempData["ResellerID"] = ResellerID;
             Client          client = new Client();
             ClientViewModel c      = ClientService.MapToViewModel(client);
             IEnumerable <OfficeSubscriptionViewModel> Subscriptions = SubscriptionService.MapToViewModel(SubscriptionService.GetAllSubscriptions());
             var myTuple = new Tuple <ClientViewModel, IEnumerable <OfficeSubscriptionViewModel> >(c, Subscriptions);
             return(View(myTuple));
         }
     }
     return(View("~/Views/Home/UnAuthorized.cshtml"));
 }
        public ActionResult ResellerIndex(Guid ResellerID)
        {
            IEnumerable <ClientViewModel>             clientViewModels = ClientService.MapToViewModel(ResellerService.GetResellerClients(ResellerID));
            IEnumerable <ClientViewModel>             Recent10Clients  = ClientService.MapToViewModel(ResellerService.GetRecent10Clients(ResellerService.GetResellerClients(ResellerID)));
            Dictionary <string, int>                  chartData        = ResellerService.GetChartData(ResellerID);
            IEnumerable <OfficeSubscriptionViewModel> Subs             = SubService.MapToViewModel(SubService.GetAllSubscriptions());
            ResellerIndexViewModel myModel = new ResellerIndexViewModel()
            {
                ChartData = chartData, RecentClients = Recent10Clients, Clients = clientViewModels, AllSubs = Subs
            };

            return(View(myModel));
        }