private SummaryOverAllExcessDeficitViews SummaryViewModel(string startMonth)
        {
            SummaryOverAllExcessDeficitViews model = new SummaryOverAllExcessDeficitViews();

            model = this.SummaryOverAllViews(startMonth);

            return(model);
        }
        public ActionResult GenerateSiteMonthlySummary(string start, string end)
        {
            SummaryOverAllExcessDeficitViews model            = new SummaryOverAllExcessDeficitViews();
            SummaryOverAllExcessDeficitViews partialViewModel = new SummaryOverAllExcessDeficitViews();

            partialViewModel.SitePivot = _excessDeficitService.GetSiteMonthlySummary(start, end);
            string siteSummaryHTML = RenderPartialViewToString("_SiteMonthlySummary", partialViewModel);

            model.SiteSummaryHTML = siteSummaryHTML;

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        // GET: HiringOutlook
        #region Summary Overall
        public ActionResult SummaryOverall()
        {
            ViewBag.User = User.Identity.GetUserName();
            SummaryOverAllExcessDeficitViews model = new SummaryOverAllExcessDeficitViews();
            int min = 0, max = 0;

            _excessDeficitService.MaxMinYear(ref min, ref max);
            model.MinYear = min;
            model.MaxYear = max;

            return(View(model));
        }
        public ActionResult GenerateLobWeeklySummary(string start, string end, string campaignID)
        {
            SummaryOverAllExcessDeficitViews model            = new SummaryOverAllExcessDeficitViews();
            SummaryOverAllExcessDeficitViews partialViewModel = new SummaryOverAllExcessDeficitViews();

            partialViewModel.LobPivot = _excessDeficitService.GetLoBWeeklySummary(start, end, campaignID);

            string lobSummaryHTML = RenderPartialViewToString("_LobWeeklySummary", partialViewModel);

            model.SiteSummaryHTML = lobSummaryHTML;

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GenerateExcessDeficitVsActualHeadcount(string start, string end, string siteID)
        {
            SummaryOverAllExcessDeficitViews model            = new SummaryOverAllExcessDeficitViews();
            SummaryOverAllExcessDeficitViews partialViewModel = new SummaryOverAllExcessDeficitViews();

            partialViewModel.SitePivot = _excessDeficitService.GetExcessDeficitVsActualHeadcount(start, end, siteID);
            partialViewModel.SiteID    = string.Empty;
            string campaignHTML = RenderPartialViewToString("_ExcessDeficitVsCurrentHeadCount", partialViewModel);

            model.Sites           = _siteService.GetAll().Where(x => x.Active == true).ToList();
            model.SiteSummaryHTML = campaignHTML;

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GenerateCampaignWeeklySummary(string start, string end, string siteID)
        {
            SummaryOverAllExcessDeficitViews model            = new SummaryOverAllExcessDeficitViews();
            SummaryOverAllExcessDeficitViews partialViewModel = new SummaryOverAllExcessDeficitViews();

            partialViewModel.SitePivot = _excessDeficitService.GetCampaignWeeklySummary(start, end, siteID);
            partialViewModel.SiteID    = siteID;
            //partialViewModel.LobPivot = _hiringOutlookService.GetLoBWeeklySummary( start, end, "" );

            string campaignHTML = RenderPartialViewToString("_CampaignWeeklySummary", partialViewModel);

            model.SiteSummaryHTML = campaignHTML;

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        public ActionResult ExcessDeficitVsCurrentHeadCount()
        {
            ViewBag.User = User.Identity.GetUserName();

            SummaryOverAllExcessDeficitViews model            = new SummaryOverAllExcessDeficitViews();
            SummaryOverAllExcessDeficitViews partialViewModel = new SummaryOverAllExcessDeficitViews();

            partialViewModel.SitePivot = _excessDeficitService.GetExcessDeficitVsActualHeadcount(string.Empty, string.Empty, string.Empty);
            partialViewModel.SiteID    = string.Empty;
            string campaignHTML = RenderPartialViewToString("_ExcessDeficitVsCurrentHeadCount", partialViewModel);

            model.Sites           = _siteService.GetAll().Where(x => x.Active == true).ToList();
            model.SiteSummaryHTML = campaignHTML;

            return(View(model));
        }
        public ActionResult SiteWeeklySummary()
        {
            ViewBag.User = User.Identity.GetUserName();

            #region Start and End date
            DateTime startDate = _commonService.StartOfWeek(DateTime.Now, DayOfWeek.Monday);
            DateTime endDate   = _commonService.GetLastMondayOfMonth(startDate.AddMonths(2));
            #endregion

            SummaryOverAllExcessDeficitViews model            = new SummaryOverAllExcessDeficitViews();
            SummaryOverAllExcessDeficitViews partialViewModel = new SummaryOverAllExcessDeficitViews();
            partialViewModel.SitePivot = _excessDeficitService.GetSiteWeeklySummary(startDate.ToString("yyyy-MM-dd"), startDate.ToString("yyyy-MM-dd"));
            string siteSummaryHTML = RenderPartialViewToString("_SiteWeeklySummary", partialViewModel);

            model.SiteSummaryHTML = siteSummaryHTML;

            return(View(model));
        }
        private SummaryOverAllExcessDeficitViews SummaryOverAllViews(string startMonth)
        {
            DateTime date = DateTime.Now;

            if (!string.IsNullOrEmpty(startMonth))
            {
                date = DateTime.Parse(startMonth);
            }

            DateTime firstDayOfMonth1 = new DateTime(date.Year, date.Month, 1);
            DateTime lastDayOfMonth1  = firstDayOfMonth1.AddMonths(1).AddDays(-1);

            DateTime firstDayOfMonth2 = firstDayOfMonth1.AddMonths(1);
            DateTime lastDayOfMonth2  = firstDayOfMonth2.AddMonths(1).AddDays(-1);

            DateTime firstDayOfMonth3 = firstDayOfMonth2.AddMonths(1);
            DateTime lastDayOfMonth3  = firstDayOfMonth3.AddMonths(1).AddDays(-1);

            SummaryOverAllExcessDeficitViews model = new SummaryOverAllExcessDeficitViews();

            model.FirstMonthSite  = _excessDeficitService.GetSiteMonthlySummary(firstDayOfMonth1.ToString("yyyy-MM-dd"), lastDayOfMonth1.ToString("yyyy-MM-dd"));
            model.SecondMonthSite = _excessDeficitService.GetSiteMonthlySummary(firstDayOfMonth2.ToString("yyyy-MM-dd"), lastDayOfMonth2.ToString("yyyy-MM-dd"));
            model.ThirdMonthSite  = _excessDeficitService.GetSiteMonthlySummary(firstDayOfMonth3.ToString("yyyy-MM-dd"), lastDayOfMonth3.ToString("yyyy-MM-dd"));

            model.FirstMonthCampaign  = _excessDeficitService.GetCampaignMonthlySummary(firstDayOfMonth1.ToString("yyyy-MM-dd"), lastDayOfMonth1.ToString("yyyy-MM-dd"));
            model.SecondMonthCampaign = _excessDeficitService.GetCampaignMonthlySummary(firstDayOfMonth2.ToString("yyyy-MM-dd"), lastDayOfMonth2.ToString("yyyy-MM-dd"));
            model.ThirdMonthCampaign  = _excessDeficitService.GetCampaignMonthlySummary(firstDayOfMonth3.ToString("yyyy-MM-dd"), lastDayOfMonth3.ToString("yyyy-MM-dd"));

            model.Month1     = firstDayOfMonth1.ToString("MMMM");
            model.Month2     = firstDayOfMonth2.ToString("MMMM");
            model.Month3     = firstDayOfMonth3.ToString("MMMM");
            model.MonthYear1 = firstDayOfMonth1.ToString("MMMM yyyy");
            model.MonthYear2 = firstDayOfMonth2.ToString("MMMM yyyy");
            model.MonthYear3 = firstDayOfMonth3.ToString("MMMM yyyy");

            int min = 0, max = 0;

            _excessDeficitService.MaxMinYear(ref min, ref max);
            model.MinYear = min;
            model.MaxYear = max;
            return(model);
        }