public override void OnGazeComplete()
        {
            base.OnGazeComplete();

            Debug.Log(surveyType.ToString());
            PlayerPrefs.SetString(SurveyUtil.surveyTypeKey, this.surveyType.ToString());
            SurveyStartManager.Instance.GoingForward();
        }
Exemplo n.º 2
0
        private static string GetSurveyTypeDescription(SurveyType item)
        {
            switch (item)
            {
            case SurveyType.CheckBox:
                return("Check Box");

            case SurveyType.FreeText:
                return("Free Text");

            default:
                return(item.ToString());
            }
        }
Exemplo n.º 3
0
 public override string ToString() =>
 string.Join(',', new string[]
             { SurveyType.ToString(),
               WaterDepth.ToString(),
               X.ToString(),
               Y.ToString(),
               GNSSAltitude.ToString(),
               GNSSHeading.ToString(),
               GNSSSpeed.ToString(),
               MagneticHeading.ToString(),
               MinRange.ToString(),
               MaxRange.ToString(),
               WaterTemperature.ToString(),
               WaterSpeed.ToString(),
               HardwareTime.ToString(),
               Frequency.ToString(),
               Milliseconds.ToString() + '\n' });
        protected string GetURL(int page, int redirDir)
        {
            bool isReset = (page == -1);

            if (isReset)
            {
                page = 1;
            }
            return(String.Format("/GSEI{5}/{0}/{1}/{2}{3}{4}", Master.PropertyShortCode.ToString(), Master.EmailPIN.ToString(), page, (redirDir == -1 ? "/-1" : String.Empty), (isReset ? "?r=1" : String.Empty), SurveyType.ToString()));
        }
        protected void btnSaveTier_Click(object sender, EventArgs e)
        {
            //Prevent refresh from re-submitting form data
            if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
            {
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
            }
            else
            {
                //Catch refresh and wipe the value again
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                return;
            }
            //Don't do anything if the tier hasn't changed
            if (ddlTier.SelectedValue.Equals(hdnOldTier.Value))
            {
                return;
            }
            //Update the tier
            SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;

            sql.ExecStoredProcedureDataTable("spFeedback_ChangeTier",
                                             new SQLParamList()
                                             .Add("@UID", GUID)
                                             .Add("@Tier", Conversion.StringToInt(ddlTier.SelectedValue, 1))
                                             .Add("@UserID", User.UserID));
            //Send tier 3 notifications
            if (ddlTier.SelectedValue.Equals("3"))
            {
                SQLParamList sqlParams = new SQLParamList();
                sqlParams.Add("@GUID", GUID);
                DataSet ds = sql.ExecStoredProcedureDataSet("[spFeedback_GetItem]", sqlParams);
                if (sql.HasError)
                {
                    TopMessage.ErrorMessage = "Unable to load the feedback item.";
                    return;
                }
                DataRow fr = ds.Tables[0].Rows[0];                 //Feedback row
                DataRow sr = ds.Tables[2].Rows[0];                 //Survey row
                GCCPropertyShortCode sc = (GCCPropertyShortCode)fr["PropertyID"].ToString().StringToInt(1);
                SurveyType           st = (SurveyType)fr["SurveyTypeID"].ToString().StringToInt(1);

                //Get the GAG location
                string gagLocation = String.Empty;
                switch (st)
                {
                case SurveyType.GEI:
                    gagLocation = sr["Q3"].ToString();
                    break;

                case SurveyType.Feedback:
                    gagLocation = sr["GAGProperty"].ToString();
                    break;
                }
                if (gagLocation.Length > 0)
                {
                    gagLocation = " - " + gagLocation;
                }

                //Send the notification
                SurveyTools.SendNotifications(Server, sc, SurveyType.Feedback, NotificationReason.Tier3Alert, string.Empty, new {
                    Date         = DateTime.Now.ToString("MMMM dd, yyyy"),
                    CasinoName   = fr["CasinoName"].ToString() + gagLocation,
                    FeedbackLink = GCCPortalUrl + "Admin/Feedback/" + fr["UID"].ToString(),
                    SurveyLink   = String.Format(GCCPortalUrl + "Display/{0}/{1}", st.ToString(), fr["RecordID"])
                });
            }
            if (sql.HasError)
            {
                TopMessage.ErrorMessage = "Oops! It looks like something went wrong trying to change the tier. Please try again. (EFB120)";
            }
        }
Exemplo n.º 6
0
        public static void SaveWordCounts(SurveyType surveyType, int recordID, Dictionary <string, int> wordCounts)
        {
            SQLDatabase   sql       = new SQLDatabase();    sql.CommandTimeout = 120;
            StringBuilder query     = new StringBuilder();
            SQLParamList  sqlParams = new SQLParamList();
            int           i         = 1;

            sqlParams.Add("@RecordID", recordID);
            foreach (string key in wordCounts.Keys)
            {
                i += 2;
                query.AppendFormat("INSERT INTO [tblSurveyWords] VALUES ({0}, @RecordID, @Word{1}, @Count{1});\n", (int)surveyType, i);
                sqlParams.Add("@Word" + i, key).Add("@Count" + i, wordCounts[key]);
                if (i >= 2097)
                {
                    //Only ~2100 parameters are allowed
                    query.Append("DELETE FROM [tblSurveyWords] WHERE Word IN (SELECT [Word] FROM [tblSurveyWords_Banned]);");
                    sql.NonQuery(query.ToString(), sqlParams);
                    i         = 1;
                    sqlParams = new SQLParamList().Add("@RecordID", recordID);
                }
            }
            if (i > 1)
            {
                query.Append("DELETE FROM [tblSurveyWords] WHERE Word IN (SELECT [Word] FROM [tblSurveyWords_Banned]);");
                sql.NonQuery(query.ToString(), sqlParams);
            }
            if (sql.HasError)
            {
                ErrorHandler.WriteLog("SharedClasses.SurveyTools.SaveWordCounts", String.Format("Unable to save word counts for {0} record ID {1}", surveyType.ToString(), recordID), ErrorHandler.ErrorEventID.SQLError, sql.ExceptionList[0]);
            }
        }