protected void Next_Click(object sender, EventArgs e)
        {
            if (ValidateAndSave(Master.CurrentPage, true, false))
            {
                //If the user selects “Ask for Donation/Support”, redirect to {propertyshortcode}/SurveyDonation.aspx
                //if (fbkQ1.SelectedIndex == 10 && Master.CurrentPage == 2)
                //20171219_Redirecting to donation request based on selection
                if (fbkQ1.SelectedIndex == 5 && Master.CurrentPage == 2)
                {
                    Response.Redirect(String.Format("/DonationRequest/{0}/", AlignedPropertyShortCode.ToString()), true);
                    return;
                }

                int nextPage = Master.CurrentPage + 1;
                if (nextPage > 5)
                {
                    nextPage = 99;
                }
                if (Master.CurrentPage == 99)
                {
                    Response.Redirect(PropertyTools.GetCasinoURL(AlignedPropertyShortCode), true);
                    return;
                }
                Response.Redirect(GetURL(nextPage, 1), true);
            }
        }
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(GUID))
            {
                SQLDatabase  sql       = new SQLDatabase();    sql.CommandTimeout = 120;
                SQLParamList sqlParams = new SQLParamList();
                UserInfo     ui        = SessionWrapper.Get <UserInfo>("UserInfo");
                sqlParams.Add("@GUID", GUID)
                .Add("@UpdateLastViewedTime", !(ui != null || RequestVars.Get <string>("a", null) != null));
                DataSet ds = sql.ExecStoredProcedureDataSet("[spFeedback_GetGuestItem]", sqlParams);
                if (!sql.HasError)
                {
                    Data = ds;

                    GCCPropertyShortCode sc = (GCCPropertyShortCode)Conversion.StringToInt(ds.Tables[0].Rows[0]["PropertyID"].ToString(), 1);

                    Master.ForceSpecificProperty      = sc;
                    MessageTimeline.PropertyShortCode = sc;

                    MessageTimeline.Messages = ds.Tables[1];
                    int feedbackStatus = Conversion.StringToInt(ds.Tables[0].Rows[0]["FeedbackStatusID"].ToString());
                    MessageTimeline.HideReplyBox = ui != null || RequestVars.Get <string>("a", null) != null;

                    Title = PropertyTools.GetCasinoName((int)sc) + " Feedback";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "GCC Food & Beverage Dashboard &raquo; " + PropertyTools.GetCasinoName((int)PropertyShortCode);
            Master.HidePropertyFilter = true;
            if (!IsPostBack && PropertyShortCode == GCCPropertyShortCode.GCC)
            {
                //Set up the restaurant list if we're looking at all locations
                SQLDatabase  sql       = new SQLDatabase();    sql.CommandTimeout = 120;
                SQLParamList sqlParams = GetFilters();
                DataTable    dt        = sql.QueryDataTable(
                    @"SELECT [RestaurantID]
                            ,[Name]
                    FROM [GCC].[dbo].[tblRestaurants]
                    WHERE RestaurantID IN (SELECT RestaurantID FROM tblPropertyRestaurants WHERE PropertyID = @PropertyID)
	                OR @PropertyID = 1
                    ORDER BY Name", sqlParams);
                if (!sql.HasError)
                {
                    ddlSelectedLocation.Items.Clear();
                    foreach (DataRow dr in dt.Rows)
                    {
                        ddlSelectedLocation.Items.Add(new ListItem(dr["Name"].ToString(), dr["RestaurantID"].ToString()));
                    }
                }
            }
        }
 private void SendNotifications()
 {
     //Send thank you letter
     if (Master.EmailPINRow != null)
     {
         SurveyTools.SendNotifications(
             Server,
             Master.PropertyShortCode,
             SharedClasses.SurveyType.GEI,
             NotificationReason.ThankYou,
             string.Empty,
             new
         {
             CasinoName       = PropertyTools.GetCasinoName((int)Master.PropertyShortCode),
             FeedbackNoteHTML = String.Empty,
             FeedbackNoteTXT  = String.Empty,
             Attachments      = new SurveyTools.SurveyAttachmentDetails[] {
                 new SurveyTools.SurveyAttachmentDetails()
                 {
                     Path = "~/Images/headers/" + PropertyTools.GetCasinoHeaderImage(Master.PropertyShortCode), ContentID = "HeaderImage"
                 }
             }
         },
             Master.EmailPINRow["EmailAddress"].ToString());
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     Title = "GCC Followup Dashboard &raquo; " + PropertyTools.GetCasinoName((int)PropertyShortCode);
     Master.HidePropertyFilter = true;
     if (PropertyShortCode == GCCPropertyShortCode.GCC)
     {
     }
 }
示例#6
0
 private void GenerateHeadings(ExcelWorksheet worksheet, Dictionary <string, DataRow> rowLookup)
 {
     _startYear       = rowLookup["DateYear"][1].ToString().StringToInt();
     _yearsInclusive  = (DateTime.Now.Year - _startYear) + 1;
     _colsPerProperty = (_yearsInclusive * 5) + 1; //+ 1 for variance column
     //Loop through and add property headers
     for (int i = 0; i < _propertySortOrder.Length; i++)
     {
         //Property name
         int propStartCol = START_COL + i * _colsPerProperty;
         worksheet.Cells[5, propStartCol].Value = PropertyTools.GetCasinoName(_propertySortOrder[i]);
         using (ExcelRange r = worksheet.Cells[5, propStartCol, 5, propStartCol + _colsPerProperty - 1])
         {
             r.Merge           = true;
             r.Style.Font.Bold = true;
             r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Medium);
             r.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
             r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
         }
         //Years
         for (int yr = 0; yr < _yearsInclusive; yr++)
         {
             bool isLastYear   = (yr == _yearsInclusive - 1);
             int  yearStartCol = propStartCol + (yr * 5);
             worksheet.Cells[6, yearStartCol].Value = _startYear + yr;
             using (ExcelRange r = worksheet.Cells[6, yearStartCol, 6, yearStartCol + (isLastYear ? 5 : 4)])
             {
                 r.Merge                     = true;
                 r.Style.Font.Bold           = true;
                 r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                 r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
                 if (yr == 0)
                 {
                     r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                 }
                 if (isLastYear)
                 {
                     r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                 }
             }
             //Quarters
             AddQuarterTitleCell(worksheet, rowLookup, yearStartCol, 1, yr == 0, false);
             AddQuarterTitleCell(worksheet, rowLookup, yearStartCol, 2, false, false);
             AddQuarterTitleCell(worksheet, rowLookup, yearStartCol, 3, false, false);
             AddQuarterTitleCell(worksheet, rowLookup, yearStartCol, 4, false, false);
             AddQuarterTitleCell(worksheet, rowLookup, yearStartCol, 5, false, false);
             //If last year for this property, add the variance column
             if (isLastYear)
             {
                 AddQuarterTitleCell(worksheet, rowLookup, yearStartCol, 6, false, true);
             }
         }
     }
 }
示例#7
0
        /// <summary>Initializes a new instance of the Behavior class.</summary>
        /// <param name="instanceProperties">Dictionary of properties to spawn this behavior instance with, if any.</param>
        protected Behavior(Dictionary <string, object> instanceProperties)
        {
            ID = 0;
            SetDefaultProperties();

            // If we're handed a set of propertyName-propertyValue pairs (as may have come from
            // persistence of the behavior or whatnot) then restore those as actual properties.
            if (instanceProperties != null)
            {
                // TODO: Test w/behavior persistence implementation...
                PropertyTools.SetProperties(this, instanceProperties);
            }
        }
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;

            sql.CommandTimeout = 120;
            SQLParamList sqlParams = GetFilters();

            if (PropertyShortCode == GCCPropertyShortCode.GCC)
            {
                sqlParams.Add("@RestaurantID", ddlSelectedLocation.SelectedValue);
            }
            DataSet ds = sql.ExecStoredProcedureDataSet("[spReports_FoodAndBev]", sqlParams);

            if (!sql.HasError)
            {
                DataFull = ds;
                //Set the dashboard counts
                if (PropertyShortCode == GCCPropertyShortCode.GCC)
                {
                    //Set it up if we're looking at all locations
                    Data = ds.Tables[1];
                }
                else
                {
                    Data = ds.Tables[0];
                    //Set it up if we're looking at a particular location
                    if (!IsPostBack)
                    {
                        for (int i = 0; i < 13; i++)
                        {
                            string name;
                            if (PropertyTools.HasFoodAndBev(PropertyShortCode, i + 1, out name))
                            {
                                ddlSelectedLocation.Items[i].Enabled = true;
                                ddlSelectedLocation.Items[i].Text    = name;
                            }
                            else
                            {
                                ddlSelectedLocation.Items[i].Enabled = false;
                            }
                        }
                    }
                }
                if (Data.Rows.Count > 0)
                {
                    string suffix = PropertyShortCode == GCCPropertyShortCode.GCC ? String.Empty : "_M" + SelectedMention;
                    Master.RecordCount = Data.Rows[0]["Count" + suffix].ToString();
                }
            }
        }
示例#9
0
        /// <summary>
        /// Initializes a new instance of the Behavior class
        /// </summary>
        /// <param name="instanceProperties">Dictionary of properties to spawn this behavior instance with, if any.</param>
        protected Behavior(Dictionary <string, object> instanceProperties)
        {
            this.ID = 0;
            this.SetDefaultProperties();

            // If we're handed a set of propertyName-propertyValue pairs (as may have come from
            // persistence of the behavior or whatnot) then restore those as actual properties.
            if (instanceProperties != null)
            {
                // @@@ TODO: Test w/behavior persistence implementation...
                // Adjusted as per feedback from thread:
                // http://www.wheelmud.net/Forums/tabid/59/aff/8/aft/1487/afv/topic/afpgj/2/Default.aspx
                PropertyTools.SetProperties(this, instanceProperties);
            }
        }
        protected void Next_Click(object sender, EventArgs e)
        {
            if (ValidateAndSave(Master.CurrentPage, true, false))
            {
                if (Master.CurrentPage == 99)
                {
                    Response.Redirect(PropertyTools.GetCasinoURL(Master.PropertyShortCode), true);
                    return;
                }

                int nextPage = Master.CurrentPage + 1;
                if (nextPage > 10)
                {
                    nextPage = 99;
                }

                Response.Redirect(GetURL(nextPage, 1), true);
            }
        }
示例#11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Title = "Rooms Dashboard &raquo; " + PropertyTools.GetCasinoName((int)PropertyShortCode);
     Master.HideDateRangeFilter    = false;
     Master.HideRegionFilter       = true;
     Master.HidePropertyFilter     = true;
     Master.HideSurveyTypeFilter   = true;
     Master.HideBusinessUnitFilter = true;
     Master.HideSourceFilter       = true;
     Master.HideStatusFilter       = false;
     Master.HideFeedbackAgeFilter  = true;
     Master.HideFBVenueFilter      = true;
     Master.HideEncoreNumberFilter = false;
     Master.HidePlayerEmailFilter  = false;
     Master.HideAgeRangeFilter     = true;
     Master.HideGenderFilter       = true;
     Master.HideLanguageFilter     = true;
     Master.HideVisitsFilter       = true;
     Master.HideSegmentsFilter     = false;
     Master.HideTenureFilter       = false;
     Master.HideTierFilter         = false;
     Master.HideTextSearchFilter   = false;
 }
示例#12
0
        //20170116 adding commentws for email notification
        //public static void SendNotifications<T>( HttpServerUtility server, GCCPropertyShortCode property, SurveyType surveyType, NotificationReason reason, T replacementModel, string emailAddress, string subjectPrefix )
        public static void SendNotifications <T>(HttpServerUtility server, GCCPropertyShortCode property, SurveyType surveyType, NotificationReason reason, string Comments, T replacementModel, string emailAddress, string subjectPrefix, int operationsArea)
            where T : class
        {
            string template     = String.Empty;
            string title        = String.Empty;
            string propertyName = PropertyTools.GetCasinoName((int)property);

            if (property == GCCPropertyShortCode.GAG)
            {
                PropertyInfo nameProp = replacementModel.GetType().GetProperty("CasinoName");
                if (nameProp != null)
                {
                    string name = nameProp.GetValue(replacementModel) as string;
                    if (!String.IsNullOrWhiteSpace(name))
                    {
                        propertyName = name;
                    }
                }
            }
            switch (surveyType)
            {
            case SurveyType.GEI:
                if (reason == NotificationReason.ThankYou)
                {
                    title    = "Thank You For Your Feedback";
                    template = "GEIThankYou";
                }
                else
                {
                    template = "GEITemplate";
                    title    = String.Format("{0}GEI Feedback Notification for {1} - {2}", subjectPrefix, propertyName, DateTime.Now.ToString("MMMM dd, yyyy"));
                }
                break;

            case SurveyType.GEIProblemResolution:
                if (reason == NotificationReason.ThankYou)
                {
                    title    = "Thank You For Your Feedback";
                    template = "GEIThankYou";
                }
                else
                {
                    if (replacementModel.ToString().Contains("FeedbackCategory"))
                    {
                        template = "GEIFeedbackCategoryTemplate";
                        title    = String.Format("{0}GEI Feedback Category Notification for {1} - {2}", subjectPrefix, propertyName, DateTime.Now.ToString("MMMM dd, yyyy"));
                    }
                    else
                    {
                        template = "GEITemplate";
                        title    = String.Format("{0}GEI Problem Resolution Feedback Notification for {1} - {2}", subjectPrefix, propertyName, DateTime.Now.ToString("MMMM dd, yyyy"));
                    }
                }
                break;

            case SurveyType.Hotel:
                if (reason == NotificationReason.ThankYou)
                {
                    title    = "Thank You For Your Feedback";
                    template = "HotelThankYou";
                }
                else
                {
                    template = "HotelTemplate";
                    title    = String.Format("{0}Hotel Survey Notification - {1}", subjectPrefix, DateTime.Now.ToString("MMMM dd, yyyy"));
                }
                break;

            case SurveyType.Feedback:
                if (reason == NotificationReason.ThankYou)
                {
                    title    = "Thank You For Your Feedback";
                    template = "FeedbackThankYou";
                }
                else if (reason == NotificationReason.Tier3Alert)
                {
                    title    = String.Format("{0}Tier 3 Alert for {1} - {2}", subjectPrefix, propertyName, DateTime.Now.ToString("MMMM dd, yyyy"));
                    template = "Tier3Alert";
                }
                else
                {
                    template = "FeedbackTemplate";
                    title    = String.Format("{0}Feedback Follow-up Notification for {1} - {2}", subjectPrefix, propertyName, DateTime.Now.ToString("MMMM dd, yyyy"));
                }
                break;

            case SurveyType.Donation:
                template = "DonationTemplate";
                title    = String.Format("{0}Sponsorship / Donation Request Notification for {1} - {2}", subjectPrefix, propertyName, DateTime.Now.ToString("MMMM dd, yyyy"));
                break;
            }
            if (template.Equals(String.Empty))
            {
                return;
            }
            MailMessage msg = null;

            try {
                string path = server.MapPath("~/Content/notifications/");
                msg = EmailManager.CreateEmailFromTemplate(
                    Path.Combine(path, template + ".htm"),
                    Path.Combine(path, template + ".txt"),
                    replacementModel);
                PropertyInfo attachmentProp = replacementModel.GetType().GetProperty("Attachments");
                if (attachmentProp != null)
                {
                    SurveyAttachmentDetails[] attachments = attachmentProp.GetValue(replacementModel) as SurveyAttachmentDetails[];
                    foreach (SurveyAttachmentDetails att in attachments)
                    {
                        LinkedResource lr = new LinkedResource(server.MapPath(att.Path));
                        lr.ContentId = att.ContentID;
                        msg.AlternateViews[0].LinkedResources.Add(lr);
                    }
                }
                msg.From    = new MailAddress("*****@*****.**");
                msg.Subject = title;
                //Add high priority flag to tier 3 alerts
                if (reason == NotificationReason.Tier3Alert)
                {
                    msg.Priority = MailPriority.High;
                }
                bool hasAddress = false;
                if (!String.IsNullOrEmpty(emailAddress))
                {
                    msg.To.Add(emailAddress);
                    hasAddress = true;
                }
                else
                {
                    SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;
                    DataTable   dt  = sql.QueryDataTable(@"
SELECT [SendType], u.[FirstName], u.[LastName],  u.[Email]
FROM [tblNotificationUsers] ne
	INNER JOIN [tblNotificationPropertySurveyReason] psr
		ON ne.[PropertySurveyReasonID] = psr.[PropertySurveyReasonID]
	INNER JOIN [tblCOM_Users] u
		ON ne.UserID = u.UserID
WHERE psr.PropertyID = @PropertyID
	AND psr.SurveyTypeID = @SurveyID
	AND psr.ReasonID = @ReasonID
	
;",
                                                         //AND ( ( @OperationsAreaID < 0 AND psr.OperationsAreaID IS NULL ) OR psr.OperationsAreaID = @OperationsAreaID )
                                                         new SQLParamList()
                                                         .Add("@PropertyID", (int)property)
                                                         .Add("@SurveyID", (int)surveyType)
                                                         .Add("@ReasonID", (int)reason)
                                                         .Add("@OperationsAreaID", operationsArea)
                                                         );
                    if (!sql.HasError && dt.Rows.Count > 0)
                    {
                        StringBuilder addrs = new StringBuilder();
                        foreach (DataRow dr in dt.Rows)
                        {
                            switch (dr["SendType"].ToString())
                            {
                            case "1":
                                msg.To.Add(dr["Email"].ToString());
                                //201701 Testing Email error
                                //msg.Bcc.Add("*****@*****.**");
                                addrs.Append(dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + " <" + dr["Email"].ToString() + ">" + "\n");
                                hasAddress = true;
                                break;

                            case "2":
                                msg.CC.Add(dr["Email"].ToString());
                                //201701 Testing Email error
                                //msg.Bcc.Add("*****@*****.**");
                                //Colin requested that CC addresses not show on the call Aug 10,2015
                                //addrs.Append( dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + " <" + dr["Email"].ToString() + ">" + "\n" );
                                hasAddress = true;
                                break;

                            case "3":
                                msg.Bcc.Add(dr["Email"].ToString());
                                //201701 Testing Email error
                                // msg.Bcc.Add("*****@*****.**");
                                hasAddress = true;
                                break;
                            }
                        }
                        using (StreamReader sr = new StreamReader(msg.AlternateViews[0].ContentStream)) {
                            msg.AlternateViews[0] = AlternateView.CreateAlternateViewFromString(sr.ReadToEnd().Replace("{Recipients}", server.HtmlEncode(addrs.ToString()).Replace("\n", "<br />")).Replace("{Business}", server.HtmlEncode(reason.ToString()).Replace("\n", "<br />")).Replace("{Comments}", server.HtmlEncode(Comments.ToString()).Replace("\n", "<br />")), null, MediaTypeNames.Text.Html);
                        }
                        using (StreamReader sr = new StreamReader(msg.AlternateViews[1].ContentStream)) {
                            msg.AlternateViews[1] = AlternateView.CreateAlternateViewFromString(sr.ReadToEnd().Replace("{Recipients}", addrs.ToString()).Replace("{Business}", reason.ToString()).Replace("{Comments}", Comments.ToString()), null, MediaTypeNames.Text.Plain);
                        }
                    }
                }

                if (hasAddress)
                {
                    msg.Send();
                }
            } catch (Exception ex) {
            } finally {
                if (msg != null)
                {
                    msg.Dispose();
                    msg = null;
                }
            }
        }
示例#13
0
 public string GetFoodAndBevName(int mention)
 {
     return(PropertyTools.GetFoodAndBevName(PropertyShortCode, mention));
 }
示例#14
0
        protected void btnExport_Click(object sender, EventArgs e)
        {
            SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;

            sql.CommandTimeout = 90;
            DataTable dt = sql.ExecStoredProcedureDataTable("spReports_Monthly_Hotel",
                                                            new SqlParameter("@MonthStart", ddlMonth.SelectedValue + "-01"),
                                                            new SqlParameter("@PropertyID", ddlProperty.SelectedValue));

            if (sql.HasError)
            {
                TopMessage.ErrorMessage = "Unable to query report data from the database.";
                return;
            }

            using (ExcelPackage p = new ExcelPackage())
            {
                string[] date = ddlMonth.SelectedValue.Split('-');
                DateTime mon  = new DateTime(date[0].StringToInt(2017), date[1].StringToInt(1), 1);

                GCCPropertyShortCode sc = (GCCPropertyShortCode)ddlProperty.SelectedValue.StringToInt(0);

                p.Workbook.Worksheets.Add(PropertyTools.GetCasinoName((int)sc));
                ExcelWorksheet worksheet = p.Workbook.Worksheets[1];
                worksheet.Cells.Style.Font.Size        = 10;        //Default font size for whole sheet
                worksheet.Cells.Style.Font.Name        = "Calibri"; //Default Font name for whole sheet
                worksheet.Cells.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                worksheet.Cells.Style.Fill.BackgroundColor.SetColor(Color.White);

                worksheet.Column(1).Width = 12.71f;
                worksheet.Column(2).Width = 54.85f;

                worksheet.Column(3).Width  = 10f;
                worksheet.Column(4).Width  = 15.42f;
                worksheet.Column(5).Width  = 14.57f;
                worksheet.Column(6).Width  = 19.28f;
                worksheet.Column(7).Width  = 19.28f;
                worksheet.Column(8).Width  = 4.14f;
                worksheet.Column(9).Width  = 10.71f;
                worksheet.Column(10).Width = 10.71f;
                worksheet.Column(11).Width = 10.71f;
                worksheet.Column(12).Width = 10.71f;;

                //Sheet title
                worksheet.Cells["A1"].Value = PropertyTools.GetCasinoName((int)sc).ToUpper() + " HOTEL GUEST EXPERIENCE REPORT";
                using (ExcelRange r = worksheet.Cells["A1:C2"])
                {
                    r.Merge                     = true;
                    r.Style.Font.Size           = 14;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.CenterContinuous;
                    r.Style.VerticalAlignment   = OfficeOpenXml.Style.ExcelVerticalAlignment.Bottom;
                }
                worksheet.Cells["A3"].Value = String.Format("REPORTING PERIOD: {0}", mon.ToString("MMMM, yyyy"));
                using (ExcelRange r = worksheet.Cells["A3:B8"])
                {
                    r.Merge                     = true;
                    r.Style.Font.Size           = 14;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.CenterContinuous;
                    r.Style.VerticalAlignment   = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
                }

                AddMergedCell(worksheet, "C7", "D7", "Green: +10% change or more", r => r.Style.Font.Bold = true);
                AddMergedCell(worksheet, "E7", "F7", "Red: -10% change or more", r => r.Style.Font.Bold   = true);

                float titleFontSize = 10f;

                AddMergedCell(worksheet, "C9", "C10", "CURRENT PERIOD", r =>
                {
                    r.Style.WrapText            = true;
                    r.Style.Font.Bold           = true;
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.Border.Top.Style    = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                });

                AddMergedCell(worksheet, "D9", "G9", "VARIANCE FROM", r =>
                {
                    r.Style.Font.Bold = true;
                    r.Style.Font.Size = titleFontSize;
                    r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                });

                AddMergedCell(worksheet, "I9", "L9", "PERFORMANCE " + (mon.AddYears(-1)).ToString("yyyy"), r =>
                {
                    r.Style.Font.Bold = true;
                    r.Style.Font.Size = titleFontSize;
                    r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                });

                AddMergedCell(worksheet, "A10", "B10", "Total Sample:", r =>
                {
                    r.Style.Font.Bold           = true;
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Right;
                });

                using (ExcelRange r = worksheet.Cells["D10"])
                {
                    r.Value                     = "PREVIOUS PERIOD";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["E10"])
                {
                    r.Value                     = "M/M Change";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["F10"]) {
                    r.Value                     = "Last 12 Mo";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["G10"]) {
                    r.Value                     = "Change from L12M";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["I10"])
                {
                    r.Value                     = "Q1/FY" + (mon.AddYears(-1)).ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["J10"])
                {
                    r.Value                     = "Q2/FY" + (mon.AddYears(-1)).ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["K10"])
                {
                    r.Value                     = "Q3/FY" + (mon.AddYears(-1)).ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["L10"])
                {
                    r.Value                     = "Q4/FY" + (mon.AddYears(-1)).ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                //Set up the lookup dictionary for getting rows when they're not all there
                Dictionary <int, DataRow> lookup = new Dictionary <int, DataRow>();
                foreach (DataRow dr in dt.Rows)
                {
                    int rowid = dr["DateRange"].ToString()[0].ToString().StringToInt();
                    lookup.Add(rowid, dr);
                }

                int rowNum = 11;

                AddDataRow(worksheet, lookup, rowNum++, true, "SAMPLE SIZE", "SampleCount", CellFormat.Number);
                // Overall Stay
                AddDataRow(worksheet, lookup, rowNum++, true, "OVERALL STAY", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Satisfaction score", "Q1Overall");
                // GSEI
                AddDataRow(worksheet, lookup, rowNum++, true, "GUEST SERVICE EXPERIENCE INDEX (GSEI)", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall GSEI", "Q2");
                AddDataRow(worksheet, lookup, rowNum++, false, "Ensuring all of your needs were met", "Q1A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Making you feel welcome", "Q1B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Going above & beyond normal service", "Q1C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Speed of service", "Q1D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Encouraging you to visit again", "Q1E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall staff availability", "Q1F");
                //ROOMS
                AddDataRow(worksheet, lookup, rowNum++, true, "ROOMS", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Rooms Score", "RoomScore");
                //Reservation, Front Desk
                AddDataRow(worksheet, lookup, rowNum++, true, "Reservation, Front Desk", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "ReservationScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of Reservation Agent", "Q3A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Helpfulness of Reservation Agent", "Q3B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of reservation information upon check-in", "Q3C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Employee knowledge of the River Rock Casino Resort & Facilities", "Q3D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Efficiency of check-in", "Q3E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of Front Desk staff", "Q3F");
                AddDataRow(worksheet, lookup, rowNum++, false, "Helpfulness of Front Desk staff", "Q3G");
                AddDataRow(worksheet, lookup, rowNum++, false, "Employees' 'can-do' attitude", "Q3H");
                AddDataRow(worksheet, lookup, rowNum++, false, "Efficiency of check-out", "Q3I");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of bill at check-out", "Q3J");
                // Housekeeping
                AddDataRow(worksheet, lookup, rowNum++, true, "Housekeeping", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "HousekeepingScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of Housekeeping staff", "Q4A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Room cleanliness", "Q4B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Bathroom cleanliness", "Q4C");
                // Hotel Room
                AddDataRow(worksheet, lookup, rowNum++, true, "Hotel Room", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "HotelRoomScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Towels & Linens", "Q5A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Proper functioning of lights, TV, etc.", "Q5B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall condition of the room", "Q5C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Adequate amenities", "Q5D");
                // Fitness Centre
                AddDataRow(worksheet, lookup, rowNum++, true, "Fitness Centre", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6FitnessCenter");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "FitnessScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Cleanliness of Fitness Center", "Q11A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality/ condition of fitness equipment", "Q11B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Availability of Fitness Center equipment", "Q11C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Variety of equipment", "Q11D");
                // Pool / Hot Tub
                AddDataRow(worksheet, lookup, rowNum++, true, "Pool / Hot Tub", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6PoolHotTub");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "PoolScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Cleanliness of pool area", "Q12A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Temperature of pool", "Q12B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Cleanliness of hot tub area", "Q12C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Temperature of hot tub", "Q12D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Cleanliness of changing rooms", "Q12E");
                // Valet Parking
                AddDataRow(worksheet, lookup, rowNum++, true, "Valet Parking", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6ValetParking");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "ValetScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Greeting upon arrival", "Q14A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Car returned in timely manner", "Q14B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Original mirror position", "Q14C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Original radio station", "Q14D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Original seat position", "Q14E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Valet driver drove care in respectful manner", "Q14F");
                AddDataRow(worksheet, lookup, rowNum++, false, "Pleasant departure greeting", "Q14G");
                // Concierge
                AddDataRow(worksheet, lookup, rowNum++, true, "Concierge", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6Concierge");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "ConciergeScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Availability of Concierge", "Q15A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of Concierge", "Q15B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Employee knowledge of the River Rock Casino Resort & Facilities", "Q15C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Staff member went out of way to provide excellent service", "Q15D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Pleasant departure greeting", "Q15E");
                // Bell /Door Service
                AddDataRow(worksheet, lookup, rowNum++, true, "Bell /Door Service", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6BellDoorService");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "BellDoorScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Greeting upon arrival", "Q16A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Acknowledgement throughout stay", "Q16B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of bell/ door staff", "Q16C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Employee knowledge of the River Rock Casino Resort & Facilities", "Q16D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Staff member went out of way to provide excellent service", "Q16E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Pleasant departure greeting", "Q16F");
                // FOOD & BEVERAGE, CATERING
                AddDataRow(worksheet, lookup, rowNum++, true, "FOOD & BEVERAGE, CATERING", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall F & B, Catering Score", "RoomScore");
                // Tramonto
                AddDataRow(worksheet, lookup, rowNum++, true, "Tramonto", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6Tramonto");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "TramontoScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Greeting upon arrival", "Q7A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Timeliness of seating", "Q7B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Attentiveness of server", "Q7C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Server's knowledge of menu selections", "Q7D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Timeliness of meal delivery", "Q7E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality and taste of food", "Q7F");
                AddDataRow(worksheet, lookup, rowNum++, false, "Presentation of food", "Q7G");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality of beverage", "Q7H");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of bill", "Q7I");
                // Buffet
                AddDataRow(worksheet, lookup, rowNum++, true, "Buffet", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6TheBuffet");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "BuffetScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Greeting upon arrival", "Q8A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Attentiveness of server", "Q8B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Server's knowledge of menu selections", "Q8C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality and taste of food", "Q8D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality of beverage", "Q8E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of bill", "Q8F");
                // Curve
                AddDataRow(worksheet, lookup, rowNum++, true, "Curve", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6Curve");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "CurveScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Greeting upon arrival", "Q9A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Timeliness of seating", "Q9B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Attentiveness of server", "Q9C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Server's knowledge of menu selections", "Q9D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Timeliness of meal delivery", "Q9E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality and taste of food", "Q9F");
                AddDataRow(worksheet, lookup, rowNum++, false, "Presentation of food", "Q9G");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality of beverage", "Q9H");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of bill", "Q9I");
                // In-Room Dining
                AddDataRow(worksheet, lookup, rowNum++, true, "In-Room Dining", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6InRoomDining");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "InRoomScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Phone answered promptly", "Q10A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of order taker", "Q10B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness of server", "Q10C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Order delivered within time period advised", "Q10D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of order", "Q10E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Presentation of food", "Q10F");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality of in-room dining food", "Q10G");
                AddDataRow(worksheet, lookup, rowNum++, false, "Delivery staff offered pick-up of empty tray", "Q10H");
                // Meeting & Events
                AddDataRow(worksheet, lookup, rowNum++, true, "Meeting & Events", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "% Used", "Q6Meeting");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Score", "MeetingScore");
                AddDataRow(worksheet, lookup, rowNum++, false, "Condition and cleanliness of meeting/event room", "Q13A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Proper meeting/event room temperature", "Q13B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality of meeting/event food and beverage", "Q13C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Friendliness and efficiency of meeting/event staff", "Q13D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality/condition/support of technical equipment", "Q13E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Meeting/event facilities (size, design, amenities)", "Q13F");
                AddDataRow(worksheet, lookup, rowNum++, false, "Accuracy of meeting/ event signage", "Q13G");
                // SERVICE RECOVERY
                AddDataRow(worksheet, lookup, rowNum++, true, "SERVICE RECOVERY", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Experience problem?", "Q23");
                AddDataRow(worksheet, lookup, rowNum++, false, "Report problem?", "Q24C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Where experienced problem? (% of all problems)", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "  Arrival", "Q24A_Arrival");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Staff", "Q24A_Staff");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Guest Room", "Q24A_GuestRoom");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Food & Beverage", "Q24A_FoodBeverage");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Facilities & Service", "Q24A_FacilitiesService");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Billing/Departure", "Q24A_BillingDeparture");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Meetings & Events", "Q24A_MeetingsEvents");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Other", "Q24A_Other");
                AddDataRow(worksheet, lookup, rowNum++, false, "", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall ability to fix problem (PRS Score)", "Q24D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "  The length of time taken to resolve your problem", "Q24E_1");
                AddDataRow(worksheet, lookup, rowNum++, false, "  The effort of employees in resolving your problem", "Q24E_2");
                AddDataRow(worksheet, lookup, rowNum++, false, "  The courteousness of employees while resolving your problem", "Q24E_3");
                AddDataRow(worksheet, lookup, rowNum++, false, "  The amount of communication with you from employees while resolving your problem", "Q24E_4");
                AddDataRow(worksheet, lookup, rowNum++, false, "  The fairness of the outcome in resolving your problem", "Q24E_5");
                // Satisfaction Attributes
                AddDataRow(worksheet, lookup, rowNum++, true, "Satisfaction Attributes", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Satisfaction with how we made you feel", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "  Welcome", "Q17A");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Comfortable", "Q17B");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Important", "Q17C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Satisfaction with Overall Stay", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "  Overall condition of the River Rock Casino Resort", "Q18A");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Value for Price", "Q18B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Likelihood to Return", "Q19");
                AddDataRow(worksheet, lookup, rowNum++, false, "Likelihood to Recommend", "Q20");
                AddDataRow(worksheet, lookup, rowNum++, false, "Received \"Exceptional\" Service", "Q21");
                AddDataRow(worksheet, lookup, rowNum++, false, "Importance of \"Green\" Initiatives", "Q22");
                AddDataRow(worksheet, lookup, rowNum++, false, "Visited River Rock before?", "Q27");
                AddDataRow(worksheet, lookup, rowNum++, false, "", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Primary Reason for Choosing (% of all Responses)", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "  Articles/Advertisements", "Q25_Articles");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Business meeting/Conference venue", "Q25_Business");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Facilities/Amenities", "Q25_Facilities");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Location", "Q25_Location");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Other, please specify", "Q25_Other");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Personal recommendation", "Q25_Personal");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Previous visit", "Q25_Previous");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Special package/rate", "Q25_Special");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Travel Agent", "Q25_Travel");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Website", "Q25_Website");
                AddDataRow(worksheet, lookup, rowNum++, false, "", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Reason to Visit (% of all Responses)", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "  Business", "Q26Business");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Pleasure", "Q26Pleasure");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Meeting / Event", "Q26MeetingEvent");
                AddDataRow(worksheet, lookup, rowNum++, false, "  Other", "Q26Other");
                AddDataRow(worksheet, lookup, rowNum++, false, "", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Follow-up on comments requested", "Q29");

                // Bottom Line
                worksheet.Cells["A" + rowNum].Value = "";
                using (ExcelRange r = worksheet.Cells["A" + rowNum + ":L" + rowNum])
                {
                    r.Merge = true;
                    r.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                }
                rowNum++;
                // Bottom Message
                worksheet.Cells["A" + rowNum].Value = "All scores are top-2 box scores on a scale of 5, unless otherwise indicated.";
                using (ExcelRange r = worksheet.Cells["A" + rowNum + ":L" + rowNum])
                {
                    r.Merge                     = true;
                    r.Style.Font.Size           = 10;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                string       fileName = sc.ToString() + "-Hotel-Monthly-" + ReportingTools.AdjustAndDisplayDate(DateTime.Now, "yyyy-MM-dd-hh-mm-ss", User) + ".xlsx";
                const string lPath    = "~/Files/Cache/";

                string lOutput = string.Concat(MapPath(lPath), fileName);

                FileInfo fi = new FileInfo(lOutput);
                p.SaveAs(fi);

                hlDownload.Text        = "Download File - " + fileName;
                hlDownload.NavigateUrl = String.Format("{0}{1}", lPath, fileName);
            }
        }
示例#15
0
 /// <summary>Initializes a new instance of the <see cref="ExportCharacterCreationStateMachineAttribute"/> class.</summary>
 /// <param name="metadata">The metadata.</param>
 public ExportCharacterCreationStateMachineAttribute(IDictionary <string, object> metadata)
 {
     PropertyTools.SetProperties(this, metadata);
 }
示例#16
0
        public static void SendFeedbackNotifications(HttpServerUtility server, string feedbackUID, bool toGuest)
        {
            SQLDatabase  sql          = new SQLDatabase();    sql.CommandTimeout = 120;
            SQLParamList sqlParams    = new SQLParamList().Add("GUID", feedbackUID);
            DataSet      ds           = sql.ExecStoredProcedureDataSet("spFeedback_GetItem", sqlParams);
            string       GCCPortalUrl = ConfigurationManager.AppSettings["GCCPortalURL"].ToString();

            if (!sql.HasError && ds.Tables[0].Rows.Count > 0)
            {
                DataRow fbkDR = ds.Tables[0].Rows[0];
                GCCPropertyShortCode property   = (GCCPropertyShortCode)fbkDR["PropertyID"].ToString().StringToInt();
                SurveyType           surveyType = (SurveyType)fbkDR["SurveyTypeID"].ToString().StringToInt();
                NotificationReason   reason     = (NotificationReason)fbkDR["ReasonID"].ToString().StringToInt();

                string emailAddress = String.Empty;
                if (toGuest)
                {
                    if (ds.Tables[2].Columns.Contains("ContactEmail"))
                    {
                        emailAddress = ds.Tables[2].Rows[0]["ContactEmail"].ToString();
                    }
                    if (String.IsNullOrWhiteSpace(emailAddress) && ds.Tables[2].Columns.Contains("Email"))
                    {
                        emailAddress = ds.Tables[2].Rows[0]["Email"].ToString();
                    }
                    if (String.IsNullOrWhiteSpace(emailAddress) && ds.Tables[2].Columns.Contains("Q5Email"))
                    {
                        emailAddress = ds.Tables[2].Rows[0]["Q5Email"].ToString();
                    }
                    if (String.IsNullOrWhiteSpace(emailAddress))
                    {
                        //Nothing to do
                        return;
                    }
                }

                string template = String.Empty;
                string title    = String.Empty;
                object replacementModel;

                title = PropertyTools.GetCasinoName((int)property) + " - Feedback Reply Notification";
                if (toGuest)
                {
                    template         = "GuestFeedbackNotification";
                    replacementModel = new {
                        CasinoName  = PropertyTools.GetCasinoName((int)property),
                        Link        = GCCPortalUrl + "F/" + feedbackUID,
                        Attachments = new SurveyTools.SurveyAttachmentDetails[] {
                            new SurveyTools.SurveyAttachmentDetails()
                            {
                                Path = "~/Images/headers/" + PropertyTools.GetCasinoHeaderImage(property), ContentID = "HeaderImage"
                            }
                        }
                    };
                }
                else
                {
                    template         = "StaffFeedbackNotification";
                    replacementModel = new {
                        Date       = DateTime.Now.ToString("yyyy-MM-dd"),
                        CasinoName = PropertyTools.GetCasinoName((int)property),
                        Link       = GCCPortalUrl + "Admin/Feedback/" + feedbackUID
                    };
                }

                MailMessage msg = null;
                try {
                    string path = server.MapPath("~/Content/notifications/");
                    msg = EmailManager.CreateEmailFromTemplate(
                        Path.Combine(path, template + ".htm"),
                        Path.Combine(path, template + ".txt"),
                        replacementModel);
                    PropertyInfo attachmentProp = replacementModel.GetType().GetProperty("Attachments");
                    if (attachmentProp != null)
                    {
                        SurveyAttachmentDetails[] attachments = attachmentProp.GetValue(replacementModel) as SurveyAttachmentDetails[];
                        foreach (SurveyAttachmentDetails att in attachments)
                        {
                            LinkedResource lr = new LinkedResource(server.MapPath(att.Path));
                            lr.ContentId = att.ContentID;
                            msg.AlternateViews[0].LinkedResources.Add(lr);
                        }
                    }
                    msg.From    = new MailAddress("*****@*****.**");
                    msg.Subject = title;
                    bool hasAddress = false;
                    if (!String.IsNullOrWhiteSpace(emailAddress))
                    {
                        msg.To.Add(emailAddress);
                        hasAddress = true;
                    }
                    else
                    {
                        sql = new SQLDatabase();
                        DataTable dt = sql.QueryDataTable(@"
SELECT [SendType], u.[FirstName], u.[LastName],  u.[Email]
FROM [tblNotificationUsers] ne
	INNER JOIN [tblNotificationPropertySurveyReason] psr
		ON ne.[PropertySurveyReasonID] = psr.[PropertySurveyReasonID]
	INNER JOIN [tblCOM_Users] u
		ON ne.UserID = u.UserID
WHERE psr.PropertyID = @PropertyID
	AND psr.SurveyTypeID = @SurveyID
	AND psr.ReasonID = @ReasonID
;",
                                                          new SQLParamList()
                                                          .Add("@PropertyID", (int)property)
                                                          .Add("@SurveyID", (int)surveyType)
                                                          .Add("@ReasonID", (int)reason)
                                                          );
                        if (!sql.HasError && dt.Rows.Count > 0)
                        {
                            StringBuilder addrs = new StringBuilder();
                            foreach (DataRow dr in dt.Rows)
                            {
                                switch (dr["SendType"].ToString())
                                {
                                case "1":
                                    msg.To.Add(dr["Email"].ToString());
                                    addrs.Append(dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + " <" + dr["Email"].ToString() + ">" + "\n");
                                    hasAddress = true;
                                    break;

                                case "2":
                                    msg.CC.Add(dr["Email"].ToString());
                                    //Colin requested that CC addresses not show on the call Aug 10,2015
                                    //addrs.Append( dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + " <" + dr["Email"].ToString() + ">" + "\n" );
                                    hasAddress = true;
                                    break;

                                case "3":
                                    msg.Bcc.Add(dr["Email"].ToString());
                                    hasAddress = true;
                                    break;
                                }
                            }
                            using (StreamReader sr = new StreamReader(msg.AlternateViews[0].ContentStream))
                            {
                                msg.AlternateViews[0] = AlternateView.CreateAlternateViewFromString(sr.ReadToEnd().Replace("{Recipients}", server.HtmlEncode(addrs.ToString()).Replace("\n", "<br />")), null, MediaTypeNames.Text.Html);
                            }
                            using (StreamReader sr = new StreamReader(msg.AlternateViews[1].ContentStream))
                            {
                                msg.AlternateViews[1] = AlternateView.CreateAlternateViewFromString(sr.ReadToEnd().Replace("{Recipients}", addrs.ToString()), null, MediaTypeNames.Text.Plain);
                            }



                            //using (StreamReader sr = new StreamReader(msg.AlternateViews[0].ContentStream))
                            //{
                            //    msg.AlternateViews[0] = AlternateView.CreateAlternateViewFromString(sr.ReadToEnd().Replace("{Recipients}", server.HtmlEncode(addrs.ToString()).Replace("\n", "<br />")).Replace("{Business}", server.HtmlEncode(reason.ToString()).Replace("\n", "<br />")).Replace("{Comments}", server.HtmlEncode(Comments.ToString()).Replace("\n", "<br />")), null, MediaTypeNames.Text.Html);
                            //}
                            //using (StreamReader sr = new StreamReader(msg.AlternateViews[1].ContentStream))
                            //{
                            //    msg.AlternateViews[1] = AlternateView.CreateAlternateViewFromString(sr.ReadToEnd().Replace("{Recipients}", addrs.ToString()).Replace("{Business}", reason.ToString()).Replace("{Comments}", Comments.ToString()), null, MediaTypeNames.Text.Plain);
                            //}
                        }
                    }

                    if (hasAddress)
                    {
                        msg.Send();
                    }
                } catch (Exception ex) {
                } finally {
                    if (msg != null)
                    {
                        msg.Dispose();
                        msg = null;
                    }
                }
            }
        }
示例#17
0
        protected void btnExport_Click(object sender, EventArgs e)
        {
            SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;

            sql.CommandTimeout = 120;
            SQLParamList sqlParams = new SQLParamList()
                                     .Add("@DR1_Begin", drDateRangeFirst.BeginDate)
                                     .Add("@DR1_End", drDateRangeFirst.EndDate)
                                     .Add("@DR2_Begin", drDateRangeSecond.BeginDate)
                                     .Add("@DR2_End", drDateRangeSecond.EndDate);

            DataTable dt = sql.ExecStoredProcedureDataTable("spReports_Comparison", sqlParams);

            if (sql.HasError)
            {
                TopMessage.ErrorMessage = "Oops. Something went wrong when exporting the data. Please try again. (ECP100)";
            }
            else
            {
                using (ExcelPackage p = new ExcelPackage())
                {
                    p.Workbook.Worksheets.Add("Comparison");
                    ExcelWorksheet worksheet = p.Workbook.Worksheets[1];

                    worksheet.Cells.Style.Font.Size = 11;                     //Default font size for whole sheet
                    worksheet.Cells.Style.Font.Name = "Calibri";              //Default Font name for whole sheet

                    worksheet.Column(1).Width = 12.71f;
                    worksheet.Column(2).Width = 62f;

                    for (int i = 0; i < _propertySortOrder.Length * 3; i++)
                    {
                        worksheet.Column(3 + i).Width = 12.71f;
                    }

                    string group1 = String.Format("{0} - {1}", drDateRangeFirst.BeginDate.Value.ToString("yyyy-MM-dd"), drDateRangeFirst.EndDate.Value.ToString("yyyy-MM-dd"));
                    string group2 = String.Format("{0} - {1}", drDateRangeSecond.BeginDate.Value.ToString("yyyy-MM-dd"), drDateRangeSecond.EndDate.Value.ToString("yyyy-MM-dd"));

                    worksheet.Cells[1, 1].Value = String.Format("First Date Range: {0}", group1);
                    worksheet.Cells[2, 1].Value = String.Format("Second Date Range: {0}", group2);

                    int rowNum = 4;

                    Action <ExcelRange> titleMerge = r =>
                    {
                        r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Medium);
                        r.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        r.Style.Font.Bold           = true;
                        r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                    };

                    Action <ExcelRange> style = r =>
                    {
                        r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
                        r.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                        r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                    };
                    int offset = 0;
                    for (int i = 0; i < _propertySortOrder.Length; i++)
                    {
                        int prop = _propertySortOrder[i];
                        if (Master.IsPropertyUser &&
                            prop != 1 &&
                            prop != ((int)User.PropertyShortCode))
                        {
                            offset -= 3;
                            continue;
                        }

                        AddValue(worksheet, rowNum, 3 + offset + i * 3, rowNum, 5 + offset + i * 3, PropertyTools.GetCasinoName(prop), titleMerge);
                        AddValue(worksheet, rowNum + 1, 3 + offset + i * 3, "First Range", r =>
                        {
                            style(r);
                            r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                        });
                        AddValue(worksheet, rowNum + 1, 4 + offset + i * 3, "Second Range", style);
                        AddValue(worksheet, rowNum + 1, 5 + offset + i * 3, "Diff.", r =>
                        {
                            style(r);
                            r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                        });
                    }

                    rowNum += 2;

                    worksheet.View.FreezePanes(rowNum, 3);

                    AddDataRow(worksheet, dt, rowNum++, true, "SAMPLE SIZE", "SampleCount", CellFormat.Number);

                    AddDataRow(worksheet, dt, rowNum++, true, "GUEST EXPERIENCE INDEX", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "GEI", "GEI", CellFormat.Index);

                    AddDataRow(worksheet, dt, rowNum++, true, "GUEST SERVICE EXPERIENCE INDEX", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "GSEI", "GSEI");

                    AddDataRow(worksheet, dt, rowNum++, true, "NET PROMOTER SCORE", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "NPS", "NPS");

                    AddDataRow(worksheet, dt, rowNum++, true, "PROBLEM RESOLUTION SCORE", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "PRS", "PRS");

                    AddDataRow(worksheet, dt, rowNum++, true, "GUEST LOYALTY", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Likely to recommend the casino", "Q6A");
                    AddDataRow(worksheet, dt, rowNum++, false, "Likely to mostly visit this casino", "Q6B");
                    AddDataRow(worksheet, dt, rowNum++, false, "Likely to visit this casino for next gaming entertainment opportunity", "Q6C");
                    AddDataRow(worksheet, dt, rowNum++, false, "Likely to provide personal preferences so casino can serve me better", "Q6D");

                    AddDataRow(worksheet, dt, rowNum++, true, "CASINO STAFF", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Ensuring all of your needs were met", "Q7A");
                    AddDataRow(worksheet, dt, rowNum++, false, "Making you feel welcome", "Q7B");
                    AddDataRow(worksheet, dt, rowNum++, false, "Going above & beyond normal service", "Q7C");
                    AddDataRow(worksheet, dt, rowNum++, false, "Speed of service", "Q7D");
                    AddDataRow(worksheet, dt, rowNum++, false, "Encouraging you to visit again", "Q7E");
                    AddDataRow(worksheet, dt, rowNum++, false, "Overall staff availability", "Q7F");

                    AddDataRow(worksheet, dt, rowNum++, false, "Overall staff", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Cashiers", "Q9A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Guest Services", "Q9B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Slot Attendants", "Q9C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Dealers", "Q9D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Restaurant Servers", "Q9E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Cocktail Servers", "Q9F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Coffee Servers", "Q9G", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Security", "Q9H", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Managers/Supervisors", "Q9I", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Hotel Staff", "Q9J", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Encouraging you to take part in events or promotions", "Q10A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Answering questions you had about the property or promotions", "Q10B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Being friendly and welcoming", "Q10C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "CASINO FACILITIES", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Overall facilities", "Q12");
                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Ambiance, mood, atmosphere of the environment", "Q13A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Cleanliness of general areas", "Q13B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Clear signage", "Q13C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Washroom cleanliness", "Q13D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Adequate  lighting - it is bright enough", "Q13E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Safe environment", "Q13F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Parking availability", "Q13G", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "GAMING EXPERIENCE", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Primary gaming:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Playing Slots", "Count_Slots", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Playing Tables", "Count_Tables", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Playing Poker", "Count_Poker", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Enjoying Food or Beverages", "Count_Food", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Watching Live Entertainment at a show lounge or theatre", "Count_Entertainment", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Staying at our Hotel", "Count_Hotel", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Watching Live Racing", "Count_LiveRacing", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Watching Racing at our Racebook", "Count_Racebook", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Playing Bingo", "Count_Bingo", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Lottery / Pull Tabs", "Count_Lottery", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "None", "Count_None", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Primary gaming:", "Q14");

                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Variety of games available", "Q15A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Waiting time to play", "Q15B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Availability of specific game at your desired denomination", "Q15C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Contests & monthly promotions", "Q15D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Courtesy & respectfulness of staff", "Q15E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Game Knowledge of Staff", "Q15F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Rate of earning", "Q16A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Redemption value", "Q16B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Choice of rewards", "Q16C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Slot Free Play", "Q16D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "FOOD & BEVERAGE", null);
                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Purchase food or beverages?", "Q17");
                    AddDataRow(worksheet, dt, rowNum++, false, "Overall dining experience", "Q19");

                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Variety of food choices", "Q20A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Cleanliness of outlet", "Q20B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Courtesy of staff", "Q20C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Timely delivery of order", "Q20D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Value for the money", "Q20E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Pleasant atmosphere", "Q20F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Quality of food", "Q20G", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "LOUNGE ENTERTAINMENT", null);
                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Attend Lounge entertainment?", "Q21");
                    AddDataRow(worksheet, dt, rowNum++, false, "Overall entertainment experience", "Q22");

                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Sound / quality", "Q23A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Seating availability", "Q23B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Dance floor", "Q23C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Fun and enjoyable atmosphere", "Q23D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "THEATRE", null);
                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Attend Theatre?", "Q24");
                    AddDataRow(worksheet, dt, rowNum++, false, "Overall Theatre experience", "Q25");

                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "The quality of the show", "Q26A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "The value of the show", "Q26B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Seating choices", "Q26C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Sound quality", "Q26D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "SERVICE RECOVERY", null);
                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Experience problem?", "Q27");
                    AddDataRow(worksheet, dt, rowNum++, false, "Where experienced problem?", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Arrival and parking", "Q27A_ArrivalAndParking", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Guest Services", "Q27A_GuestServices", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Cashiers", "Q27A_Cashiers", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Manager/Supervisor", "Q27A_ManagerSupervisor", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Security", "Q27A_Security", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Slots", "Q27A_Slots", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Tables", "Q27A_Tables", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Food & Beverage", "Q27A_FoodAndBeverage", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Hotel", "Q27A_Hotel", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Other", "Q27A_Other", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Resolve problem?", "Q28");
                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Report problem?", "Q29");
                    AddDataRow(worksheet, dt, rowNum++, false, "Overall ability to fix problem", "Q30");
                    AddDataRow(worksheet, dt, rowNum++, false, "Attribute ratings:", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "The length of time taken to resolve your problem", "Q31A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "The effort of employees in resolving your problem", "Q31B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "The courteousness of employees while resolving your problem", "Q31C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    worksheet.Row(rowNum).Height *= 2;
                    AddDataRow(worksheet, dt, rowNum++, false, "The amount of communication with you from employees while resolving your problem", "Q31D", CellFormat.Percent, r => { r.Style.WrapText = true; r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "The fairness of the outcome in resolving your problem", "Q31E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                    AddDataRow(worksheet, dt, rowNum++, true, "DEMOGRAPHICS", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Male", "Q36_Male");
                    AddDataRow(worksheet, dt, rowNum++, false, "Female", "Q36_Female");
                    AddDataRow(worksheet, dt, rowNum++, false, String.Empty, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "19-24", "Q37_19-24");
                    AddDataRow(worksheet, dt, rowNum++, false, "25-34", "Q37_25-34");
                    AddDataRow(worksheet, dt, rowNum++, false, "35-44", "Q37_35-44");
                    AddDataRow(worksheet, dt, rowNum++, false, "45-54", "Q37_45-54");
                    AddDataRow(worksheet, dt, rowNum++, false, "55-64", "Q37_55-64");
                    AddDataRow(worksheet, dt, rowNum++, false, "65 or older", "Q37_65 or older");
                    AddDataRow(worksheet, dt, rowNum++, false, String.Empty, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "First visit", "Q38_This was my first visit");
                    AddDataRow(worksheet, dt, rowNum++, false, "2-7 times per week", "Q38_2-7 times per week");
                    AddDataRow(worksheet, dt, rowNum++, false, "Once per week", "Q38_Once per week");
                    AddDataRow(worksheet, dt, rowNum++, false, "2-3 times per month", "Q38_2-3 times per month");
                    AddDataRow(worksheet, dt, rowNum++, false, "Once per month", "Q38_Once per month");
                    AddDataRow(worksheet, dt, rowNum++, false, "Several times a year", "Q38_Several times a year");

                    AddDataRow(worksheet, dt, rowNum++, false, "Languages spoken at home (other than English)", null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Korean", "Q39_1", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Punjabi", "Q39_2", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Chinese Mandarin", "Q39_3", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Other Western European languages", "Q39_4", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Eastern European languages", "Q39_5", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Spanish", "Q39_6", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "French", "Q39_7", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Hindi", "Q39_8", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Tagalog", "Q39_9", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Vietnamese", "Q39_10", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Pakistani", "Q39_11", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Farsi", "Q39_12", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Japanese", "Q39_13", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Arabic / Middle Eastern", "Q39_14", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Chinese – Cantonese", "Q39_15", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, "Other", "Q39_16", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                    AddDataRow(worksheet, dt, rowNum++, false, String.Empty, null);
                    rowNum = AddYesNoRow(worksheet, dt, rowNum++, false, "Players Club?", "Q4");

                    rowNum++;                     //Skip one row

                    string       lFileName = string.Format("DateRangeComparison-{0}.xlsx", ReportingTools.AdjustAndDisplayDate(DateTime.Now, "yyyy-MM-dd-hh-mm-ss-fff", User));
                    const string lPath     = "~/Files/Cache/";

                    string lOutput = string.Concat(MapPath(lPath), lFileName);

                    FileInfo fi = new FileInfo(lOutput);
                    p.SaveAs(fi);

                    hlDownload.Text        = "Download File - " + lFileName;
                    hlDownload.NavigateUrl = String.Format("{0}{1}", lPath, lFileName);
                }
            }
        }
示例#18
0
        public void ProcessRequest(HttpContext context)
        {
            //Only run locally or in the network
            string ip = RequestVars.GetRequestIPv4Address();

            if (!ip.Equals("127.0.0.1") && !ip.StartsWith("172.16.") && !ip.StartsWith("192.168.0."))
            {
                ErrorHandler.WriteLog("GCC_Web_Portal.Jobs", "Job attempted to be run by invalid IP: " + ip, ErrorHandler.ErrorEventID.General);
                return;
            }
            //Get the job ID
            string jobID = RequestVars.Get("jobid", String.Empty);

            switch (jobID)
            {
            case "e07db58b-d3a6-4e01-a5ed-ff9875773b3c":

                #region Send weekly notification email

                DateTime startDate = DateTime.Now.Date.AddDays(-7);
                DateTime endDate   = DateTime.Now.Date.AddMilliseconds(-1);
                //DateTime startDate = new DateTime( 2015, 7, 1 ).Date;
                //DateTime endDate = new DateTime( 2015, 8, 1 ).Date.AddMilliseconds( -1 );
                SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;
                DataTable   dt  = sql.ExecStoredProcedureDataTable("spJobs_StatusEmail",
                                                                   new SQLParamList()
                                                                   .Add("@DateCreated_Begin", startDate)
                                                                   .Add("@DateCreated_End", endDate));
                StringBuilder sbCurrent = new StringBuilder();
                sbCurrent.AppendFormat(@"<h3 style='margin:20px 0'>GEI / GSEI Dashboard for {0} to {1}</h3><table style='border-collapse:collapse;border:1px solid #444;width:100%' cellspacing='0' cellpadding='0'>", startDate.ToString("MMM d, yyyy"), endDate.ToString("MMM d, yyyy"));
                sbCurrent.AppendFormat("<thead><tr><th{0}></th><th{0}># Surveys</th><th{0}>GEI</th><th{0}>NPS</th><th{0}>PRS</th><th{0}>GSEI</th><th{0}># Followup</th><th{0}>% Followup</th><th{0}># <24h</th><th{0}>#24-48h</th><th{0}># > 48h</th><th{0}>Avg. Response</th></tr></thead>",
                                       " style='padding:5px;border:1px solid #BBB'");
                StringBuilder sbComparison = new StringBuilder("<h3 style='margin:20px 0'>Change from Previous Week</h3><table style='border-collapse:collapse;border:1px solid #444;width:100%' cellspacing='0' cellpadding='0'>");
                sbComparison.AppendFormat("<thead><tr><th{0}></th><th{0}># Surveys</th><th{0}>GEI</th><th{0}>NPS</th><th{0}>PRS</th><th{0}>GSEI</th><th{0}># Followup</th><th{0}>% Followup</th><th{0}># <24h</th><th{0}>#24-48h</th><th{0}># > 48h</th><th{0}>Avg. Response</th></tr></thead>",
                                          " style='padding:5px;border:1px solid #BBB'");
                Dictionary <string, List <string> > redFlagDetails = new Dictionary <string, List <string> >();
                foreach (DataRow dr in dt.Rows)
                {
                    sbCurrent.AppendFormat("<tr><th style='padding:5px;text-align:left;border:1px solid #BBB;'>{0}</th><td{12}>{1:#,###}</td><td{12}>{2}</td><td{12}>{3}</td><td{12}>{4}</td><td{12}>{5}</td><td{12}>{6:#,###}</td><td{12}>{7:#,###}</td><td{12}>{8:#,###}</td><td{12}>{9:#,###}</td><td{12}>{10:#,###}</td><td{12}>{11}</td></tr>",
                                           dr["ShortCode"],
                                           dr["TotalRecords"],
                                           ReportingTools.FormatIndex(dr["GEI"].ToString()),
                                           ReportingTools.FormatPercent(dr["NPS"].ToString()),
                                           ReportingTools.FormatPercent(dr["PRS"].ToString()),
                                           ReportingTools.FormatPercent(dr["GSEI"].ToString()),
                                           dr["FeedbackCount"], //6
                                           ReportingTools.FormatPercent(dr["FeedbackCompletePercent"].ToString()),
                                           dr["FeedbackLessThan24Hrs"],
                                           dr["Feedback24HrsTo48Hrs"],
                                           dr["FeedbackGreaterThan48Hrs"],
                                           ReportingTools.MinutesToNiceTime(dr["AverageFeedbackResponse"].ToString()),
                                           " style='padding:5px;border:1px solid #BBB;text-align:center'"
                                           );
                    sbComparison.AppendFormat("<tr><th style='padding:5px;text-align:left;border:1px solid #BBB;'>{0}</th>{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}</tr>",
                                              dr["ShortCode"],
                                              GetChangeCell(dr, "TotalRecords_Diff", String.Format("{0:#,###}", dr["TotalRecords"]), redFlagDetails, null),
                                              GetChangeCell(dr, "GEI_Diff", ReportingTools.FormatIndex(dr["GEI_Diff"].ToString()), redFlagDetails, r => { return(r != -1000 && r <= -10); }),
                                              GetChangeCell(dr, "NPS_Diff", ReportingTools.FormatPercent(dr["NPS_Diff"].ToString()), redFlagDetails, r => { return(r != -1000 && r <= -0.1); }),
                                              GetChangeCell(dr, "PRS_Diff", ReportingTools.FormatPercent(dr["PRS_Diff"].ToString()), redFlagDetails, r => { return(r != -1000 && r <= -0.1); }),
                                              GetChangeCell(dr, "GSEI_Diff", ReportingTools.FormatPercent(dr["GSEI_Diff"].ToString()), redFlagDetails, r => { return(r != -1000 && r <= -0.1); }),
                                              GetChangeCell(dr, "FeedbackCount_Diff", String.Format("{0:#,###}", dr["FeedbackCount_Diff"]), redFlagDetails, null), //6
                                              GetChangeCell(dr, "FeedbackCompletePercent_Diff", ReportingTools.FormatPercent(dr["FeedbackCompletePercent_Diff"].ToString()), redFlagDetails, r => { return(r != -1000 && r <= -0.1); }),
                                              GetChangeCell(dr, "FeedbackLessThan24Hrs_Diff", String.Format("{0:#,###}", dr["FeedbackLessThan24Hrs_Diff"]), redFlagDetails, null),
                                              GetChangeCell(dr, "Feedback24HrsTo48Hrs_Diff", String.Format("{0:#,###}", dr["Feedback24HrsTo48Hrs_Diff"]), redFlagDetails, null),
                                              GetChangeCell(dr, "FeedbackGreaterThan48Hrs_Diff", String.Format("{0:#,###}", dr["FeedbackGreaterThan48Hrs_Diff"]), redFlagDetails, null),
                                              GetChangeCell(dr, "AverageFeedbackResponse_Diff", ReportingTools.MinutesToNiceTime(dr["AverageFeedbackResponse_Diff"].ToString()), redFlagDetails, r => { return(r != -1000 && r >= 120); })
                                              );
                }
                sbCurrent.Append("</table><br /><br /><br />");
                sbComparison.Append("</table>");

                StringBuilder sbRedFlags = new StringBuilder();
                foreach (var kvp in redFlagDetails)
                {
                    if (sbRedFlags.Length == 0)
                    {
                        sbRedFlags.Append("<h3 style='margin:20px 0'>Red Flag Summary</h3><ul>");
                    }
                    if (kvp.Key.Length <= 4)
                    {
                        //Score
                        sbRedFlags.AppendFormat("<li><b>{0} score</b> has decreased by at least 10% for the following site(s): ", kvp.Key);
                    }
                    else if (kvp.Key.Equals("FeedbackCompletePercent"))
                    {
                        //Completion percentage
                        sbRedFlags.Append("<li><b>Feedback Completion</b> has decreased by at least 10% for the following site(s): ");
                    }
                    else if (kvp.Key.Equals("AverageFeedbackResponse"))
                    {
                        //Feedback response
                        sbRedFlags.Append("<li><b>Average Feedback Response</b> has increased by at least 2 hours for the following site(s): ");
                    }
                    foreach (string shortCode in kvp.Value)
                    {
                        sbRedFlags.AppendFormat("{0}, ", shortCode);
                    }
                    sbRedFlags.Remove(sbRedFlags.Length - 2, 2)
                    .Append("</li>");
                }
                if (sbRedFlags.Length > 0)
                {
                    sbRedFlags.Append("</ul><br />");
                    sbCurrent.Insert(0, sbRedFlags.ToString());
                }

                MailMessage msg = null;
                try
                {
                    var replacementModel = new
                    {
                        DataTables = sbCurrent.ToString() + sbComparison.ToString()
                    };
                    string path = context.Server.MapPath("~/Content/notifications/");
                    msg = EmailManager.CreateEmailFromTemplate(
                        Path.Combine(path, "WeeklyNotification.htm"),
                        replacementModel);
                    msg.IsBodyHtml   = true;
                    msg.BodyEncoding = System.Text.Encoding.UTF8;
                    msg.From         = new MailAddress("*****@*****.**");
                    msg.Subject      = "GCGC Weekly Status Notification - Week Ending " + endDate.ToString("MMM d, yyyy");
                    bool hasAddress = false;

                    dt = sql.QueryDataTable(@"
SELECT [SendType], u.[FirstName], u.[LastName],  u.[Email]
FROM [tblNotificationUsers] ne
	INNER JOIN [tblNotificationPropertySurveyReason] psr
		ON ne.[PropertySurveyReasonID] = psr.[PropertySurveyReasonID]
	INNER JOIN [tblCOM_Users] u
		ON ne.UserID = u.UserID
WHERE psr.PropertyID = @PropertyID
    AND psr.SurveyTypeID = @SurveyID
    AND psr.ReasonID = @ReasonID
;",
                                            new SQLParamList()
                                            .Add("@PropertyID", (int)GCCPropertyShortCode.GCC)
                                            .Add("@SurveyID", (int)SurveyType.GEI)
                                            .Add("@ReasonID", (int)NotificationReason.WeeklyStatusNotification)
                                            );
                    if (!sql.HasError && dt.Rows.Count > 0)
                    {
                        StringBuilder addrs = new StringBuilder();
                        foreach (DataRow dr in dt.Rows)
                        {
                            switch (dr["SendType"].ToString())
                            {
                            case "1":
                                msg.To.Add(dr["Email"].ToString());
                                addrs.Append(dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + " <" + dr["Email"].ToString() + ">" + "\n");
                                hasAddress = true;
                                break;

                            case "2":
                                msg.CC.Add(dr["Email"].ToString());
                                //Colin requested that CC addresses not show on the call Aug 10,2015
                                //addrs.Append( dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + " <" + dr["Email"].ToString() + ">" + "\n" );
                                hasAddress = true;
                                break;

                            case "3":
                                msg.Bcc.Add(dr["Email"].ToString());
                                hasAddress = true;
                                break;
                            }
                        }
                        //using ( StreamReader sr = new StreamReader( msg.AlternateViews[0].ContentStream ) ) {
                        //    msg.AlternateViews[0] = AlternateView.CreateAlternateViewFromString( sr.ReadToEnd().Replace( "{Recipients}", context.Server.HtmlEncode( addrs.ToString() ).Replace( "\n", "<br />" ) ), null, MediaTypeNames.Text.Html );
                        //}
                    }

                    if (hasAddress)
                    {
                        msg.Send();
                    }
                }
                catch (Exception ex)
                {
                    ErrorHandler.WriteLog("GCC_Web_Portal.Jobs", "Error running job.", ErrorHandler.ErrorEventID.General, ex);
                }
                finally
                {
                    if (msg != null)
                    {
                        msg.Dispose();
                        msg = null;
                    }
                }
                return;

                #endregion Send weekly notification email

            case "506aebb3-dfa2-4b34-94bc-51e81f5f31d3":

                #region Send Feedback Reminder Email

                sql = new SQLDatabase();
                dt  = sql.ExecStoredProcedureDataTable("[spJobs_48HrReminder]");
                foreach (DataRow dr in dt.Rows)
                {
                    GCCPropertyShortCode sc;
                    SurveyType           st;
                    NotificationReason   nr;
                    DateTime             created = Conversion.XMLDateToDateTime(dr["DateCreated"].ToString());
                    string feedbackUID           = dr["UID"].ToString();
                    if (Enum.TryParse(dr["PropertyID"].ToString(), out sc) &&
                        Enum.TryParse(dr["SurveyTypeID"].ToString(), out st) &&
                        Enum.TryParse(dr["ReasonID"].ToString(), out nr))
                    {
                        switch (st)
                        {
                        case SurveyType.GEI:
                            string gagLocation = dr["GEIGAGLocation"].ToString();
                            if (gagLocation.Length > 0)
                            {
                                gagLocation = " - " + gagLocation;
                            }
                            string fbLink = GCCPortalUrl + "Admin/Feedback/" + feedbackUID;
                            SurveyTools.SendNotifications(HttpContext.Current.Server, sc, st, nr, string.Empty,
                                                          new
                            {
                                Date               = created.ToString("yyyy-MM-dd"),
                                CasinoName         = PropertyTools.GetCasinoName((int)sc) + gagLocation,
                                Problems           = (dr["Q27"].Equals(1) ? "Yes" : "No"),
                                Response           = (dr["Q40"].Equals(1) ? "Yes" : "No"),
                                ProblemDescription = dr["Q27B"].ToString(),
                                StaffComment       = dr["Q11"].ToString(),
                                GeneralComments    = dr["Q34"].ToString(),
                                MemorableEmployee  = dr["Q35"].ToString(),
                                FeedbackLinkTXT    = (String.IsNullOrWhiteSpace(feedbackUID) ? String.Empty : "\n\nRespond to this feedback:\n" + fbLink + "\n"),
                                FeedbackLinkHTML   = (String.IsNullOrWhiteSpace(feedbackUID) ? String.Empty : @"<br /><br />
	<p><b>Respond to this feedback:</b></p>
	<p>"     + fbLink + "</p>"),
                                SurveyLink = GCCPortalUrl + "Display/GEI/" + dr["RecordID"].ToString()
                            },
                                                          String.Empty,
                                                          "Overdue: ");
                            break;

                        case SurveyType.Hotel:
                            SurveyTools.SendNotifications(HttpContext.Current.Server, sc, st, nr, string.Empty,
                                                          new
                            {
                                CasinoName       = PropertyTools.GetCasinoName((int)sc),
                                FeedbackNoteHTML = "<p><b>This guest has requested a response.</b> You can view and respond to the feedback request by clicking on (or copying and pasting) the following link:</p>\n<p>" + GCCPortalUrl + "Admin/Feedback/" + feedbackUID + "</p>",
                                FeedbackNoteTXT  = "The guest requested feedback. You can view and respond to the feedback request by clicking on (or copying and pasting) the following link:\n" + GCCPortalUrl + "Admin/Feedback/" + feedbackUID + "\n\n",
                                SurveyLink       = GCCPortalUrl + "Display/Hotel/" + dr["RecordID"].ToString()
                            },
                                                          String.Empty,
                                                          "Overdue: ");
                            break;

                        case SurveyType.Feedback:
                            gagLocation = dr["FBKGAGLocation"].ToString();
                            if (gagLocation.Length > 0)
                            {
                                gagLocation = " - " + gagLocation;
                            }
                            SurveyTools.SendNotifications(HttpContext.Current.Server, sc, st, nr, string.Empty,
                                                          new
                            {
                                Date             = created.ToString("yyyy-MM-dd"),
                                CasinoName       = PropertyTools.GetCasinoName((int)sc) + gagLocation,
                                FeedbackNoteHTML = "<p><b>This guest has requested a response.</b> You can view and respond to the feedback request by clicking on (or copying and pasting) the following link:</p>\n<p>" + GCCPortalUrl + "Admin/Feedback/" + feedbackUID + "</p>",
                                FeedbackNoteTXT  = "The guest requested feedback. You can view and respond to the feedback request by clicking on (or copying and pasting) the following link:\n" + GCCPortalUrl + "Admin/Feedback/" + feedbackUID + "\n\n",
                                SurveyLink       = GCCPortalUrl + "Display/Feedback/" + dr["RecordID"].ToString()
                            },
                                                          String.Empty,
                                                          "Overdue: ");
                            break;

                        case SurveyType.Donation:
                            SurveyTools.SendNotifications(HttpContext.Current.Server, sc, st, nr, string.Empty,
                                                          new
                            {
                                Date         = created.ToString("yyyy-MM-dd"),
                                CasinoName   = PropertyTools.GetCasinoName((int)sc),
                                FeedbackLink = GCCPortalUrl + "Admin/Feedback/" + feedbackUID,
                                Link         = GCCPortalUrl + "Display/Donation/" + dr["RecordID"].ToString()
                            },
                                                          String.Empty,
                                                          "Overdue: ");
                            break;
                        }
                    }
                }
                return;

                #endregion Send Feedback Reminder Email
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write("Invalid Job ID.");
        }
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            int j = 1;

            //slots
            fbkQ2.Items[j++].Enabled = (new[] { "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECB", "ECF", "ECGR", "ECM" }.Contains(AlignedPropertyShortCode.ToString()));
            //Electronic Table Games
            fbkQ2.Items[j++].Enabled = (new[] { "ECM", "ECF" }.Contains(AlignedPropertyShortCode.ToString()));
            //Table Games / Poker
            fbkQ2.Items[j++].Enabled = (new[] { "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "ECV", "NAN", "GAG", "CNSH", "CNSS", "ECS", "SCTI", "CNB", "SCBE", "WDB", "GBH", "ECB" }.Contains(AlignedPropertyShortCode.ToString()));

            //Bingo
            fbkQ2.Items[j++].Enabled = (new[] { "BCO", "GCC", "CCH", "CMR", "CDC" }.Contains(AlignedPropertyShortCode.ToString()));
            //Food & Beverage
            fbkQ2.Items[j++].Enabled = (new[] { "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Entertainment
            fbkQ2.Items[j++].Enabled = (new[] { "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "CCH", "CMR", "CDC", "CNSH", "ECS", "ECM", "ECF" }.Contains(AlignedPropertyShortCode.ToString()));
            //Hotel
            fbkQ2.Items[j++].Enabled = (new[] { "BCO", "NSB", "GCC", "RR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Racebook
            fbkQ2.Items[j++].Enabled = (new[] { "BCO", "GCC", "RR", "HRCV", "HA", "NAN", "CMR", "CNSS", "ECS", "SSKD", "SCBE", "AJA" }.Contains(AlignedPropertyShortCode.ToString()));
            //Horse Racing
            fbkQ2.Items[j++].Enabled = (new[] { "BCO", "ONO", "GCC", "HA", "CNSS", "ECS", "ECF", "ECM", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Motorcoach / Bus Tours
            fbkQ2.Items[j++].Enabled = (new[] { "GCC", "CNSH" }.Contains(AlignedPropertyShortCode.ToString()));
            //Guest Services
            fbkQ2.Items[j++].Enabled = (new[] { "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Parking
            fbkQ2.Items[j++].Enabled = (new[] { "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECF", "ECGR", "ECB" }.Contains(AlignedPropertyShortCode.ToString()));
            //Marketing & Promotions
            fbkQ2.Items[j++].Enabled = (new[] { "CO", "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECF", "ECGR", "ECB" }.Contains(AlignedPropertyShortCode.ToString()));
            //Group Sales / Catering / Events
            fbkQ2.Items[j++].Enabled = (new[] { "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "CNSH", "SSKD", "SCTI", "SCBE", "CNB", "WDB", "GBH", "AJA", "ECM", "ECF", "ECGR", "ECB" }.Contains(AlignedPropertyShortCode.ToString()));
            //Sponsorship Request
            fbkQ2.Items[j++].Enabled = (new[] { "CO", "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "WDB", "GBH", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Responsible Gaming
            fbkQ2.Items[j++].Enabled = (new[] { "CO", "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Investor Relations
            fbkQ2.Items[j++].Enabled = (new[] { "CO", "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Media Requests & Inquiries
            fbkQ2.Items[j++].Enabled = (new[] { "CO", "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "WDB", "GBH", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));
            //Other
            fbkQ2.Items[j++].Enabled = (new[] { "CO", "WSO", "BCO", "NSB", "ONO", "GCC", "RR", "HRCV", "HA", "ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS", "ECS", "SSKD", "SCTI", "CNB", "SCBE", "AJA", "ECM", "ECB", "ECF", "ECGR" }.Contains(AlignedPropertyShortCode.ToString()));



            //Slots
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Table Games / Poker
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD","ECV", "NAN", "GAG", "CNSH", "CNSS","ECS", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Bingo
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "CCH", "CMR", "CDC" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Food & Beverage
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Entertainment
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "CCH", "CMR", "CDC", "CNSH","ECS" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Hotel
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Racebook
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA", "NAN", "CMR", "CNSS","ECS", "SSKD" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Horse Racing
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "FD", "HA", "CNSS","ECS" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Motorcoach / Bus Tours
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "CNSH" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Guest Services
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Parking
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Marketing & Promotions
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Group Sales / Catering / Events
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "CNSH", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Sponsorship Request
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Responsible Gaming
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Investor Relations
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Media Requests & Inquiries
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Other
            //fbkQ2.Items[j++].Enabled = ( new[] { "GCC", "RR", "HRCV", "FD", "HA","ECV", "NAN", "CCH", "CMR", "CDC", "GAG", "CNSH", "CNSS","ECS", "SSKD", "SCTI" }.Contains( AlignedPropertyShortCode.ToString() ) );
            ////Check all previous pages
            //Must do in LoadComplete because controls load values in Load method (Init didn't work because reasons...)



            //if (AlignedPropertyShortCode == GCCPropertyShortCode.ECF || AlignedPropertyShortCode == GCCPropertyShortCode.ECB || AlignedPropertyShortCode == GCCPropertyShortCode.ECM || AlignedPropertyShortCode == GCCPropertyShortCode.ECGR)
            //{
            //    fbkQ2.Items[3].Text = "Electronic Table Games";
            //}



            if (AlignedPropertyShortCode.ToString() == "CNB" || AlignedPropertyShortCode.ToString() == "SCTI" || AlignedPropertyShortCode.ToString() == "WDB")
            {
                btnEnglish.Visible = true;
                btnFrench.Visible  = true;
                if (Session["CurrentUI"] == null)
                {
                    Session["CurrentUI"] = "en-CA";
                }
            }
            else
            {
                btnEnglish.Visible   = false;
                btnFrench.Visible    = false;
                Session["CurrentUI"] = "en-CA";
            }

            if (Master.CurrentPage > 1 && !IsPostBack)
            {
                for (int i = 1; i < Master.CurrentPage; i++)
                {
                    //System.Diagnostics.Debug.WriteLine( "Checking Page: " + i );
                    if (!ValidateAndSave(i, false, false))
                    {
                        //System.Diagnostics.Debug.WriteLine( "Invalid Page: " + i );
                        Response.Redirect(GetURL(i, Master.RedirectDirection), true);
                        return;
                    }
                }
                if (PageShouldBeSkipped(Master.CurrentPage))
                {
                    int nextPage = Master.CurrentPage + Master.RedirectDirection;
                    if (Master.CurrentPage == 4 && Master.RedirectDirection == 1)
                    {
                        nextPage = 99;
                    }
                    Response.Redirect(GetURL(nextPage, Master.RedirectDirection), true);
                    return;
                }
                //If we've made it to 99, save to database.
                if (Master.CurrentPage == 99 && !IsPostBack)
                {
                    int surveyID;
                    if (SaveData(out surveyID))
                    {
                        FeedbackID = surveyID;
                        string feedbackUID;
                        AddFeedback(surveyID, out feedbackUID);
                        SendNotifications(surveyID, feedbackUID);
                        FeedbackUID    = feedbackUID;
                        SurveyComplete = true;
                        //If not a staff survey, abandon the session, else, remove control session keys.
                        if (!IsStaffSurvey)
                        {
                            Session.Abandon();
                        }
                        else
                        {
                            WipeSurveyControls(Controls);
                        }
                        if (Session["CurrentUI"].ToString() == "fr-CA")
                        {
                            mmLastPage.FrSuccessMessage = String.Format("<p>Merci d’avoir donné vos impressions! Vos réponses ont été transférées à un représentant. Si vous avez demandé une réponse de notre part, veuillez attendre de nos nouvelles d’ici 12 à 24 heures. Veuillez vérifier votre dossier de pourriels ou ajouter « @gcgamingsurvey.com » à votre carnet d’adresses.<br /><br />Si votre question est plus urgente, veuillez communiquer avec le service à la clientèle au {0}.</p>", PropertyTools.GetPhoneNumber(AlignedPropertyShortCode, 0));
                        }
                        else
                        {
                            mmLastPage.SuccessMessage = String.Format("<p>Thank you for your feedback! Your responses have been forwarded to the appropriate representative. If you have requested a response, please expect contact within 12-24 hours. Please ensure you check your \"Junk Mail\" folder or add \"@gcgamingsurvey.com\" to your email account's white list.<br /><br />If your question is more urgent, please contact Guest Services at {0}.</p>", PropertyTools.GetPhoneNumber(AlignedPropertyShortCode, 0));
                        }
                    }
                    else
                    {
                        mmLastPage.ErrorMessage = "We were unable to save your responses. Please go back and try again.";
                    }
                }
            }
        }
        private void SendNotifications(int surveyID, string feedbackUID)
        {
            string gagLocation = String.Empty;

            if (AlignedPropertyShortCode == GCCPropertyShortCode.GAG)
            {
                if (radGAG_Everett.Checked)
                {
                    gagLocation = "Everett";
                }
                else if (radGAG_Lakewood.Checked)
                {
                    gagLocation = "Lakewood";
                }
                else if (radGAG_Tukwila.Checked)
                {
                    gagLocation = "Tukwila";
                }
                else if (radGAG_DeMoines.Checked)
                {
                    gagLocation = "DeMoines";
                }
                if (gagLocation.Length > 0)
                {
                    gagLocation = " - " + gagLocation;
                }
            }



            // 2018 04 18 Adding notification users for no specific property
            // Adding proper PropertyID for No Specific Property Region Operations

            //if (AlignedPropertyShortCode == GCCPropertyShortCode.GCC && fbkProperty.SelectedIndex == 24)   // No specific Property
            //{


            //    if (Master.PropertyShortCode == GCCPropertyShortCode.GCC)
            //    {
            //        int selectedProp = Conversion.StringToInt(fbkDirectQuestion.SelectedValue, 0);
            //        if (selectedProp != 0)
            //        {
            //            try
            //            {
            //                GCCPropertyShortCode sc = (GCCPropertyShortCode)selectedProp;
            //                NoSpecificPropertyShortCode = sc;
            //            }
            //            catch
            //            {
            //                NoSpecificPropertyShortCode = GCCPropertyShortCode.GCC;
            //            }
            //        }
            //        else
            //        {
            //            NoSpecificPropertyShortCode = GCCPropertyShortCode.GCC;
            //        }
            //    }
            //    else
            //    {
            //        NoSpecificPropertyShortCode = Master.PropertyShortCode;
            //    }



            //  //  AlignedPropertyShortCode = (GCCPropertyShortCode)Convert.ToInt32(fbkDirectQuestion.SelectedValue.ToString());

            //}


            NotificationReason nr = (NotificationReason)fbkQ2.SelectedValue.StringToInt();

            //Send the notification
            SurveyTools.SendNotifications(
                Server,
                AlignedPropertyShortCode,
                SharedClasses.SurveyType.Feedback,
                nr,
                fbkQ3.Text.ToString(),
                new
            {
                Date             = DateTime.Now.ToString("yyyy-MM-dd"),
                CasinoName       = Master.CasinoName + gagLocation,
                FeedbackNoteHTML = String.IsNullOrEmpty(feedbackUID) ? String.Empty : "<p><b>This guest has requested a response.</b> You can view and respond to the feedback request by clicking on (or copying and pasting) the following link:</p>\n<p>" + GCCPortalUrl + "Admin/Feedback/" + feedbackUID + "</p>",
                FeedbackNoteTXT  = String.IsNullOrEmpty(feedbackUID) ? String.Empty : "The guest requested feedback. You can view and respond to the feedback request by clicking on (or copying and pasting) the following link:\n" + GCCPortalUrl + "Admin/Feedback/" + feedbackUID + "\n\n",
                SurveyLink       = GCCPortalUrl + "Display/Feedback/" + surveyID
            },
                String.Empty,
                String.Empty,
                fbkDirectQuestion.SelectedValue.StringToInt(-1)
                );
            //Determine triggers for feedback request
            if (!IsStaffSurvey &&
                !fbkQ5.SelectedValue.Equals("I do not want to be contacted") &&
                !String.IsNullOrEmpty(txtEmailContact.Text))
            {
                //Send thank you letter
                SurveyTools.SendNotifications(
                    Server,
                    AlignedPropertyShortCode,
                    SharedClasses.SurveyType.Feedback,
                    NotificationReason.ThankYou,
                    string.Empty,
                    new
                {
                    CasinoName = PropertyTools.GetCasinoName(Master.PropertyID),

                    Attachments = new SurveyTools.SurveyAttachmentDetails[]
                    {
                        new SurveyTools.SurveyAttachmentDetails()
                        {
                            Path = "~/Images/headers/" + PropertyTools.GetCasinoHeaderImage(AlignedPropertyShortCode), ContentID = "HeaderImage"
                        }
                    }
                },
                    txtEmailContact.Text,
                    String.Empty,
                    fbkDirectQuestion.SelectedValue.StringToInt(-1));
            }
        }
示例#21
0
 public string GetShowLoungeName(bool checkHRCV)
 {
     return(PropertyTools.GetShowLoungeName(PropertyShortCode, ((!checkHRCV || (String.IsNullOrEmpty(Data["Q21_HRCV_Lounge"].ToString()) && String.IsNullOrEmpty(Data["Q21_EC_Lounge"].ToString()))) ? 0 : (Data["Q21_HRCV_Lounge"].Equals("Asylum") || Data["Q21_EC_Lounge"].Equals("Molson Lounge") ? 1 : 2))));
 }
示例#22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Title = "GCC GEI / NPS Dashboard &raquo; " + PropertyTools.GetCasinoName((int)PropertyShortCode);
     Master.HidePropertyFilter = true;
 }
示例#23
0
 /// <summary>Initializes a new instance of the class.</summary>
 /// <param name="metadata">The metadata.</param>
 public BaseExportAttribute(IDictionary <string, object> metadata)
 {
     PropertyTools.SetProperties(this, metadata);
 }
示例#24
0
        protected void btnExport_Click(object sender, EventArgs e)
        {
            SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;

            sql.CommandTimeout = 90;
            DataTable dt = sql.ExecStoredProcedureDataTable("spReports_Monthly",
                                                            new SqlParameter("@MonthStart", ddlMonth.SelectedValue + "-01"),
                                                            new SqlParameter("@PropertyID", ddlProperty.SelectedValue));

            if (sql.HasError)
            {
                TopMessage.ErrorMessage = "Unable to query report data from the database.";
                return;
            }

            using (ExcelPackage p = new ExcelPackage())
            {
                string[] date = ddlMonth.SelectedValue.Split('-');
                DateTime mon  = new DateTime(date[0].StringToInt(2017), date[1].StringToInt(1), 1);

                GCCPropertyShortCode sc = (GCCPropertyShortCode)ddlProperty.SelectedValue.StringToInt(0);

                p.Workbook.Worksheets.Add(PropertyTools.GetCasinoName((int)sc));
                ExcelWorksheet worksheet = p.Workbook.Worksheets[1];
                worksheet.Cells.Style.Font.Size        = 10;        //Default font size for whole sheet
                worksheet.Cells.Style.Font.Name        = "Calibri"; //Default Font name for whole sheet
                worksheet.Cells.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                worksheet.Cells.Style.Fill.BackgroundColor.SetColor(Color.White);

                worksheet.Column(1).Width = 12.71f;
                worksheet.Column(2).Width = 54.85f;

                worksheet.Column(3).Width  = 10f;
                worksheet.Column(4).Width  = 15.42f;
                worksheet.Column(5).Width  = 14.57f;
                worksheet.Column(6).Width  = 19.28f;
                worksheet.Column(7).Width  = 4.14f;
                worksheet.Column(8).Width  = 10.71f;
                worksheet.Column(9).Width  = 10.71f;
                worksheet.Column(10).Width = 10.71f;
                worksheet.Column(11).Width = 10.71f;;

                //Sheet title
                worksheet.Cells["A1"].Value = PropertyTools.GetCasinoName((int)sc).ToUpper() + " GUEST EXPERIENCE REPORT";
                using (ExcelRange r = worksheet.Cells["A1:B8"])
                {
                    r.Merge                     = true;
                    r.Style.Font.Size           = 14;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.CenterContinuous;
                    r.Style.VerticalAlignment   = OfficeOpenXml.Style.ExcelVerticalAlignment.Bottom;
                }
                worksheet.Cells["A9"].Value = String.Format("REPORTING PERIOD: {0}", mon.ToString("MMMM, yyyy"));
                using (ExcelRange r = worksheet.Cells["A9:B14"])
                {
                    r.Merge                     = true;
                    r.Style.Font.Size           = 14;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.CenterContinuous;
                    r.Style.VerticalAlignment   = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
                }

                //Legend
                worksheet.Cells["C1"].Value = "LEGEND";
                using (ExcelRange r = worksheet.Cells["C1:K1"])
                {
                    r.Merge                    = true;
                    r.Style.Font.Size          = 12;
                    r.Style.Font.Bold          = true;
                    r.Style.VerticalAlignment  = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
                    r.Style.Border.Left.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                    r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium;
                }
                AddMergedCell(worksheet, "C2", "K2", "- Net Promoter Score (NPS) = difference in percentage of top two box and bottom two box to the 'likelihood to recommend' question.", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; });
                AddMergedCell(worksheet, "C3", "K3", "- Guest Experience Index (GEI) = weighted average of responses to Guest Loyalty questions converted to a 100 point equal interval scale.", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; });
                AddMergedCell(worksheet, "C4", "K4", "- Problem Resolution Score (PRS) =  of those who had a problem, top two box percentage of \"overall ability to fix problem\" question.", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; });
                AddMergedCell(worksheet, "C5", "K5", "- 5 point scales used:", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; });
                AddMergedCell(worksheet, "C6", "K6", "RATIONAL CONNECTIONS, TOUCHPOINTS, ATTRIBUTES: excellent, very good, good, fair, poor", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Indent = 2; });
                AddMergedCell(worksheet, "C7", "K7", "EMOTIONAL CONNECTIONS, BRAND CONNECTIONS: strongly agree,moderately agree, slightly agree,disagree, strongly disagree", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Indent = 2; });
                AddMergedCell(worksheet, "C8", "K8", "GUEST LOYALTY: definitely would, probably would, possibly would, probably would not, definitely would not", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Indent = 2; });
                AddMergedCell(worksheet, "C9", "K9", "- Performance Score %: Top Two Box % = excellent+very good; strongly agree+moderately agree; definitely would +probably would", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; });
                AddMergedCell(worksheet, "C10", "K10", "- GCGC numbers are total for  all properties ", r => { r.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; r.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Medium; });

                AddMergedCell(worksheet, "C12", "D12", "Green: +10% change or more", r => r.Style.Font.Bold = true);
                AddMergedCell(worksheet, "E12", "F12", "Red: -10% change or more", r => r.Style.Font.Bold   = true);

                float titleFontSize = 10f;

                AddMergedCell(worksheet, "C14", "C15", "CURRENT PERIOD", r =>
                {
                    r.Style.WrapText            = true;
                    r.Style.Font.Bold           = true;
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.Border.Top.Style    = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                });

                AddMergedCell(worksheet, "D14", "F14", "VARIANCE FROM", r =>
                {
                    r.Style.Font.Bold = true;
                    r.Style.Font.Size = titleFontSize;
                    r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                });

                AddMergedCell(worksheet, "H14", "K14", "PERFORMANCE " + "2015", r =>
                {
                    r.Style.Font.Bold = true;
                    r.Style.Font.Size = titleFontSize;
                    r.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                });

                AddMergedCell(worksheet, "A15", "B15", "Total Sample:", r =>
                {
                    r.Style.Font.Bold           = true;
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Right;
                });

                using (ExcelRange r = worksheet.Cells["D15"])
                {
                    r.Value                     = "PREVIOUS PERIOD";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["E15"])
                {
                    r.Value                     = "YEAR AGO";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["F15"])
                {
                    r.Value                     = "CURRENT PERIOD GCGC";
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["H15"])
                {
                    r.Value                     = "Q1/FY15"; //+mon.ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["I15"])
                {
                    r.Value                     = "Q2/FY15"; //+mon.ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["J15"])
                {
                    r.Value                     = "Q3/FY15"; // + mon.ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                using (ExcelRange r = worksheet.Cells["K15"])
                {
                    r.Value                     = "Q4/FY15"; //+mon.ToString("yy");
                    r.Style.Font.Size           = titleFontSize;
                    r.Style.Font.Bold           = true;
                    r.Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    r.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                }

                //Set up the lookup dictionary for getting rows when they're not all there
                Dictionary <int, DataRow> lookup = new Dictionary <int, DataRow>();
                foreach (DataRow dr in dt.Rows)
                {
                    int rowid = dr["DateRange"].ToString()[0].ToString().StringToInt();
                    lookup.Add(rowid, dr);
                }

                int rowNum = 16;

                AddDataRow(worksheet, lookup, rowNum++, true, "SAMPLE SIZE", "SampleCount", CellFormat.Number);

                AddDataRow(worksheet, lookup, rowNum++, true, "GUEST EXPERIENCE INDEX", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "GEI", "GEI", CellFormat.Index);

                AddDataRow(worksheet, lookup, rowNum++, true, "GUEST SERVICE EXPERIENCE INDEX", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "GSEI", "GSEI");

                AddDataRow(worksheet, lookup, rowNum++, true, "NET PROMOTER SCORE", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "NPS", "NPS");

                AddDataRow(worksheet, lookup, rowNum++, true, "PROBLEM RESOLUTION SCORE", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "PRS", "PRS");

                AddDataRow(worksheet, lookup, rowNum++, true, "GUEST LOYALTY", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Likely to recommend the casino", "Q6A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Likely to mostly visit this casino", "Q6B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Likely to visit this casino for next gaming entertainment opportunity", "Q6C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Likely to provide personal preferences so casino can serve me better", "Q6D");

                AddDataRow(worksheet, lookup, rowNum++, true, "CASINO STAFF", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Ensuring all of your needs were met", "Q7A");
                AddDataRow(worksheet, lookup, rowNum++, false, "Making you feel welcome", "Q7B");
                AddDataRow(worksheet, lookup, rowNum++, false, "Going above & beyond normal service", "Q7C");
                AddDataRow(worksheet, lookup, rowNum++, false, "Speed of service", "Q7D");
                AddDataRow(worksheet, lookup, rowNum++, false, "Encouraging you to visit again", "Q7E");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall staff availability", "Q7F");

                AddDataRow(worksheet, lookup, rowNum++, false, "Overall staff", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Cashiers", "Q9A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Guest Services", "Q9B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Slot Attendants", "Q9C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Dealers", "Q9D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Restaurant Servers", "Q9E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Cocktail Servers", "Q9F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Coffee Servers", "Q9G", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Security", "Q9H", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Managers/Supervisors", "Q9I", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Hotel Staff", "Q9J", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Encouraging you to take part in events or promotions", "Q10A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Answering questions you had about the property or promotions", "Q10B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Being friendly and welcoming", "Q10C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, true, "CASINO FACILITIES", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall facilities", "Q12");
                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Ambiance, mood, atmosphere of the environment", "Q13A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Cleanliness of general areas", "Q13B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Clear signage", "Q13C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Washroom cleanliness", "Q13D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Adequate  lighting - it is bright enough", "Q13E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Safe environment", "Q13F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Parking availability", "Q13G", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, true, "GAMING EXPERIENCE", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Primary gaming:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Playing Slots", "Count_Slots", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Playing Tables", "Count_Tables", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Playing Poker", "Count_Poker", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Enjoying Food or Beverages", "Count_Food", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Watching Live Entertainment at a show lounge or theatre", "Count_Entertainment", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Staying at our Hotel", "Count_Hotel", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Watching Live Racing", "Count_LiveRacing", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Watching Racing at our Racebook", "Count_Racebook", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Playing Bingo", "Count_Bingo", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Lottery / Pull Tabs", "Count_Lottery", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "None", "Count_None", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Primary gaming:", "Q14");

                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Variety of games available", "Q15A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Waiting time to play", "Q15B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Availability of specific game at your desired denomination", "Q15C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Contests & monthly promotions", "Q15D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Courtesy & respectfulness of staff", "Q15E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Game Knowledge of Staff", "Q15F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Rate of earning", "Q16A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Redemption value", "Q16B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Choice of rewards", "Q16C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Slot Free Play", "Q16D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, true, "FOOD & BEVERAGE", null);
                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Purchase food or beverages?", "Q17");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall dining experience", "Q19");

                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Variety of food choices", "Q20A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Cleanliness of outlet", "Q20B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Courtesy of staff", "Q20C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Timely delivery of order", "Q20D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Value for the money", "Q20E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Pleasant atmosphere", "Q20F", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Quality of food", "Q20G", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, true, "LOUNGE ENTERTAINMENT", null);
                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Attend Lounge entertainment?", "Q21");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall entertainment experience", "Q22");

                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Sound / quality", "Q23A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Seating availability", "Q23B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Dance floor", "Q23C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Fun and enjoyable atmosphere", "Q23D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, true, "THEATRE", null);
                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Attend Theatre?", "Q24");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall Theatre experience", "Q25");

                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "The quality of the show", "Q26A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "The value of the show", "Q26B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Seating choices", "Q26C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Sound quality", "Q26D", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                //AddDataRow( worksheet, lookup, rowNum++, false, "Overall customer service of Theatre staff", "Q26E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null );

                AddDataRow(worksheet, lookup, rowNum++, true, "SERVICE RECOVERY", null);
                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Experience problem?", "Q27");
                AddDataRow(worksheet, lookup, rowNum++, false, "Where experienced problem?", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Arrival and parking", "Q27A_ArrivalAndParking", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Guest Services", "Q27A_GuestServices", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Cashiers", "Q27A_Cashiers", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Manager/Supervisor", "Q27A_ManagerSupervisor", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Security", "Q27A_Security", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Slots", "Q27A_Slots", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Tables", "Q27A_Tables", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Food & Beverage", "Q27A_FoodAndBeverage", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Hotel", "Q27A_Hotel", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Other", "Q27A_Other", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Resolve problem?", "Q28");
                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Report problem?", "Q29");
                AddDataRow(worksheet, lookup, rowNum++, false, "Overall ability to fix problem", "Q30");
                AddDataRow(worksheet, lookup, rowNum++, false, "Attribute ratings:", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "The length of time taken to resolve your problem", "Q31A", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "The effort of employees in resolving your problem", "Q31B", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "The courteousness of employees while resolving your problem", "Q31C", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                worksheet.Row(rowNum).Height *= 2;
                AddDataRow(worksheet, lookup, rowNum++, false, "The amount of communication with you from employees while resolving your problem", "Q31D", CellFormat.Percent, r => { r.Style.WrapText = true; r.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center; r.Style.Indent = 3; }, r => { r.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center; });
                AddDataRow(worksheet, lookup, rowNum++, false, "The fairness of the outcome in resolving your problem", "Q31E", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);

                AddDataRow(worksheet, lookup, rowNum++, true, "DEMOGRAPHICS", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Male", "Q36_Male");
                AddDataRow(worksheet, lookup, rowNum++, false, "Female", "Q36_Female");
                AddDataRow(worksheet, lookup, rowNum++, false, String.Empty, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "19-24", "Q37_19-24");
                AddDataRow(worksheet, lookup, rowNum++, false, "25-34", "Q37_25-34");
                AddDataRow(worksheet, lookup, rowNum++, false, "35-44", "Q37_35-44");
                AddDataRow(worksheet, lookup, rowNum++, false, "45-54", "Q37_45-54");
                AddDataRow(worksheet, lookup, rowNum++, false, "55-64", "Q37_55-64");
                AddDataRow(worksheet, lookup, rowNum++, false, "65 or older", "Q37_65 or older");
                AddDataRow(worksheet, lookup, rowNum++, false, String.Empty, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "First visit", "Q38_This was my first visit");
                AddDataRow(worksheet, lookup, rowNum++, false, "2-7 times per week", "Q38_2-7 times per week");
                AddDataRow(worksheet, lookup, rowNum++, false, "Once per week", "Q38_Once per week");
                AddDataRow(worksheet, lookup, rowNum++, false, "2-3 times per month", "Q38_2-3 times per month");
                AddDataRow(worksheet, lookup, rowNum++, false, "Once per month", "Q38_Once per month");
                AddDataRow(worksheet, lookup, rowNum++, false, "Several times a year", "Q38_Several times a year");

                AddDataRow(worksheet, lookup, rowNum++, false, "Languages spoken at home (other than English)", null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Korean", "Q39_1", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Punjabi", "Q39_2", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Chinese Mandarin", "Q39_3", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Other Western European languages", "Q39_4", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Eastern European languages", "Q39_5", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Spanish", "Q39_6", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "French", "Q39_7", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Hindi", "Q39_8", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Tagalog", "Q39_9", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Vietnamese", "Q39_10", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Pakistani", "Q39_11", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Farsi", "Q39_12", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Japanese", "Q39_13", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Arabic / Middle Eastern", "Q39_14", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Chinese – Cantonese", "Q39_15", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, "Other", "Q39_16", CellFormat.Percent, r => { r.Style.Indent = 3; }, null);
                AddDataRow(worksheet, lookup, rowNum++, false, String.Empty, null);
                rowNum = AddYesNoRow(worksheet, lookup, rowNum++, false, "Players Club?", "Q4");

                string       fileName = sc.ToString() + "-Monthly-" + ReportingTools.AdjustAndDisplayDate(DateTime.Now, "yyyy-MM-dd-hh-mm-ss", User) + ".xlsx";
                const string lPath    = "~/Files/Cache/";

                string lOutput = string.Concat(MapPath(lPath), fileName);

                FileInfo fi = new FileInfo(lOutput);
                p.SaveAs(fi);

                hlDownload.Text        = "Download File - " + fileName;
                hlDownload.NavigateUrl = String.Format("{0}{1}", lPath, fileName);
            }
        }