Пример #1
0
        public ActionResult SchedulerToDeactivateSponsor()
        {
            dynamic jsonData = default(dynamic);

            try
            {
                SponsorshipRequestEntity sponsorshipReqObj = new SponsorshipRequestEntity();
                sponsorshipReqObj.CreatedBy = Convert.ToInt32(Session["UserID"]);
                List <SponsorshipExpiredListEntity> ExpiredListObj = new SponsorshipService().GetExpiredSponsorshipList(sponsorshipReqObj);
                bool isDeactivated = new SponsorshipService().SchedulerToDeactivateSponsor(sponsorshipReqObj);
                if (isDeactivated)
                {
                    foreach (var item in ExpiredListObj)
                    {
                        if (Utility.CacheHandler.Exists(item.Name.ToLower().Replace(" ", "-")))
                        {
                            UpVotes.Utility.CacheHandler.Clear(item.Name.ToLower().Replace(" ", "-"));
                        }
                    }

                    jsonData = new
                    {
                        IsSuccess = true,
                    };
                }
                else
                {
                    jsonData = new
                    {
                        IsSuccess = false,
                    };
                }
            }
            catch (Exception)
            {
                jsonData = new
                {
                    IsSuccess = false
                };
            }
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult ApplySponsorship(SponsorshipRequestEntity sponsorshipReqObj)
        {
            dynamic jsonData = default(dynamic);

            try
            {
                sponsorshipReqObj.CreatedBy = Convert.ToInt32(Session["UserID"]);
                bool isApplied = new SponsorshipService().ApplySponsorship(sponsorshipReqObj);

                if (isApplied)
                {
                    if (Utility.CacheHandler.Exists(sponsorshipReqObj.CompanyOrSoftwareName.ToLower().Replace(" ", "-")))
                    {
                        UpVotes.Utility.CacheHandler.Clear(sponsorshipReqObj.CompanyOrSoftwareName.ToLower().Replace(" ", "-"));
                    }

                    jsonData = new
                    {
                        IsSuccess = true,
                    };
                }
                else
                {
                    jsonData = new
                    {
                        IsSuccess = false,
                    };
                }
            }
            catch (Exception)
            {
                jsonData = new
                {
                    IsSuccess = false
                };
            }
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
 public ActionResult GetSchedulerForm()
 {
     if (Session["UserDashboardInfo"] != null)
     {
         DashboardViewModel dashboardObj = new DashboardViewModel();
         dashboardObj = (Session["UserDashboardInfo"] as DashboardViewModel);
         if (dashboardObj.IsAdmin && ((UserEntity)Session["UserObj"]).UserType == 4)
         {
             SponsorshipRequestEntity sponsorshipReqObj = new SponsorshipRequestEntity();
             sponsorshipReqObj.CreatedBy = Convert.ToInt32(Session["UserID"]);
             List <SponsorshipExpiredListEntity> ExpiredListObj = new SponsorshipService().GetExpiredSponsorshipList(sponsorshipReqObj);
             return(PartialView("~/Views/Authenticated/Center/SchedulerForm.cshtml", ExpiredListObj));
         }
         else
         {
             return(PartialView("~/Views/Error/PageNotFound.cshtml"));
         }
     }
     else
     {
         return(PartialView("~/Views/Error/PageNotFound.cshtml"));
     }
 }