Exemplo n.º 1
0
    public string GetShowGoogleMapsApiDirectionsResultCodeMessageScript()
    {
        var sb           = new StringBuilder();
        var questionTask = new QuestionUserTask(UserConnection);
        var caption      = questionTask.WarningCaption;

        sb.AppendLine("function ShowGoogleMapsApiDirectionsResultCodeMessage(mainMessageText, status) {");
        sb.AppendLine("var message = '';");
        sb.AppendLine("if (status == google.maps.DirectionsStatus.OK) { return; }");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.ZERO_RESULTS) { message = '" + GetLocalizableStringValue("DirectionsErrorZeroResultsCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.OVER_QUERY_LIMIT) { message = '" + GetLocalizableStringValue("TooManyQueriesErrorCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.REQUEST_DENIED) { message = '" + GetLocalizableStringValue("DirectionsErrorRequestDeniedCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.MAX_WAYPOINTS_EXCEEDED) { message = '" + GetLocalizableStringValue("DirectionsErrorMaxWaypointsExceededCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.NOT_FOUND) { message = '" + GetLocalizableStringValue("DirectionsErrorNotFoundCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.UNKNOWN_ERROR) { message = '" + GetLocalizableStringValue("ServerErrorErrorCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.DirectionsStatus.INVALID_REQUEST) { message = '" + GetLocalizableStringValue("ServerErrorErrorCause") + "' ;} ");
        sb.AppendLine("var warningMessageText = mainMessageText;");
        sb.AppendLine("if (message != '') { warningMessageText += ' (' + message + ')'; }");
        sb.AppendLine("Ext.MessageBox.message(");
        sb.AppendLine("'" + caption + "',");
        sb.AppendLine("warningMessageText,");
        sb.AppendLine("Ext.MessageBox.OK,");
        sb.AppendLine("Ext.MessageBox.WARNING,");
        sb.AppendLine("function(btn) {;}" + ",");
        sb.AppendLine("this");
        sb.AppendLine(");");
        sb.AppendLine("}");
        return(sb.ToString());
    }
Exemplo n.º 2
0
    public string GetShowGoogleMapsApiGeocodingResultCodeMessageScript()
    {
        var sb           = new StringBuilder();
        var questionTask = new QuestionUserTask(UserConnection);
        var caption      = questionTask.WarningCaption;

        sb.AppendLine("function ShowGoogleMapsApiGeocodingResultCodeMessage(mainMessageText, status) {");
        sb.AppendLine("var message = '';");
        sb.AppendLine("if (status == google.maps.GeocoderStatus.OK) { return; }");
        sb.AppendLine("else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) { message = '" + GetLocalizableStringValue("UnknownAddressErrorCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) { message = '" + GetLocalizableStringValue("TooManyQueriesErrorCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.GeocoderStatus.REQUEST_DENIED) { message = '" + GetLocalizableStringValue("ServerErrorErrorCause") + "' ;} ");
        sb.AppendLine("else if (status == google.maps.GeocoderStatus.INVALID_REQUEST) { message = '" + GetLocalizableStringValue("MissingQueryErrorCause") + "' ;} ");
        sb.AppendLine("var warningMessageText = mainMessageText;");
        sb.AppendLine("if (message != '') { warningMessageText += ' (' + message + ')'; }");
        sb.AppendLine("Ext.MessageBox.message(");
        sb.AppendLine("'" + caption + "',");
        sb.AppendLine("warningMessageText,");
        sb.AppendLine("Ext.MessageBox.OK,");
        sb.AppendLine("Ext.MessageBox.WARNING,");
        sb.AppendLine("function(btn) {;}" + ",");
        sb.AppendLine("this");
        sb.AppendLine(");");
        sb.AppendLine("}");
        return(sb.ToString());
    }
Exemplo n.º 3
0
    public string GetShowWarningMessageScript(string messageText)
    {
        var sb           = new StringBuilder();
        var questionTask = new QuestionUserTask(UserConnection);
        var caption      = questionTask.WarningCaption;

        sb.AppendLine("Ext.MessageBox.message(");
        sb.AppendLine("'" + caption + "',");
        sb.AppendLine("'" + messageText.Replace("'", @"\'") + "',");
        sb.AppendLine("Ext.MessageBox.OK,");
        sb.AppendLine("Ext.MessageBox.WARNING,");
        sb.AppendLine("function(btn) {;}" + ",");
        sb.AppendLine("this");
        sb.AppendLine(");");
        return(sb.ToString());
    }