All Answers

0 votes
In reply to: Payment Gateways

Hi Ruben

Under the hood, Wisej.Net use Net6 or DotNet Framework (4.8) , with c# or vb.net

Out there there a lot of information of how integrate a traditonial aspnet solution with others platforme providers that you can adapt it to your needs.

Also you can evaluate our consulting services for any specific needs

Regards

  • Paul answered Jun 16, 2022 - 2:44 pm
  • last active Jun 16, 2022 - 2:54 pm
0 votes
In reply to: Compress Image Quality

 

using System.Drawing.Drawing2D;

//set max width and height we are willing to accept e.g HD Image
double maxWidth = 1920;
double maxHeight = 1080;

double srcWidth = src_image.Width;
double srcHeight = src_image.Height;

double widthRatio = maxWidth / srcWidth;
double heightRatio = maxHeight / srcHeight;

double ratio = Math.Min(widthRatio, heightRatio);

//set new dimensions with aspect ratio preserved
int newWidth = (int)(srcWidth * ratio);
int newHeight = (int)(srcHeight * ratio);

Size size = new Size(newWidth, newHeight);

Image out_image = (Image)(new Bitmap(src_image, size));

  • David answered Jun 16, 2022 - 9:02 am
0 votes

Hi Paul, I have attached a sample demonstrating what I’m looking for in a theme. The sample is slow but hopefully it’s enough to show what I mean.

Thanks!

  • vincent_ answered Jun 16, 2022 - 6:50 am
0 votes
In reply to: Session Variables

Thank you for your answer. I created a small sample and it worked as I expected it to work. This makes me think I’ve done something wrong in my main project’s code. I have a static SessionManager object that I’ve created, and I think that may be leading to the problem. I will do further research now. Thanks again.

0 votes
In reply to: Session Variables

Hi Lloyd

Please, could you send us a small runnable sample that reproduce the issue?

by the way, Session are isolated, there is no way to cross data in Application.Session

Regards.

  • Paul answered Jun 15, 2022 - 8:02 pm
0 votes

Hi Vencent

Could you please, put an image with what you have in mind ?

thanks

  • Paul answered Jun 15, 2022 - 2:05 pm
0 votes
In reply to: Compress Image Quality

Hi Ruben,

while Wisej already compresses all communication between client and server (http and websocket) we don´t offer any specialized extension for image compression.
However there are a gazillion tools for VB.NET and C# out there that you can use with Wisej.NET like you did in WinForms before.
Some are commercial, others are free.

Best regards
Frank

0 votes
In reply to: Google Drive

Hello Luca,

many thanks for your help. Now it works. You rescued me.

 

0 votes
In reply to: File Editor For WiseJ

Hi Ruben,

you can use our Wisej AceEditor extension:

https://github.com/iceteagroup/wisej-extensions/tree/3.0/Wisej.Web.Ext.AceEditor

It includes line numbers and a lot more.

Best regards
Frank

  • Frank (ITG) answered Jun 13, 2022 - 9:19 pm
  • last active Jun 13, 2022 - 9:20 pm
0 votes
In reply to: Google Drive

OAuth2 authentication works by navigating to the authentication server (authentication url) passing a redirect url (which is your callback basically). The authentication server authenticates and navigates back your web application’s redirect url passing back a code, then the application makes one more requests using the code and receives a token.

SPA apps may do this in a popup window, but it requires the authentication flow to be executed in javascript. Wisej supports both ways. They are both a bit confusing and the samples from microsoft (onedrive) and google are fragmented and not always working.

If you implemented the Web approach (not SPA) you have to handle the redirection with the code. I have attached a sample generics GoogleApiHelper class that works for most Google services, usage:

 

 var service = await GoogleApiHelper.GetServiceAsync<DriveService>(UserId, "Application Name", "http://localhost:64191/");
 var listRequest = service.Files.List();
 listRequest.PageSize = 100;
 listRequest.Fields = "nextPageToken, files(id, name)";

 // List files.
 var files = listRequest.Execute().Files;

Run in an async method, like

private async void button1_Click(object sender, EventArgs e)

It expects a file “client_secrets.json” which is the authorization credentials downloaded from Google developer console. I followed Google web authorization examples and code in github.

You will have to adapt the code to your needs. The solution key is in the Application_ApplicationRefresh handler and the async task callback. The sample also shows you how to make your authentication method async.

HTH

 

  • Luca answered Jun 13, 2022 - 2:11 pm
0 votes
In reply to: Google Drive

Hello Luca,

many thanks for your fast answer.
I am so happy about wisej framework, because it is really the best tool to convert my windows-application to a cloud-app.

And it works so good, that it is not really necessary to be a ASP-NET developer.
But now this is my problem.

In the attachment you can find a sample to connect google drive by different ways.
It authenficates to google, a google window lets select the private account and gives the privileges to read the data in the private drive-account and if this all was successfull the sample shows the filenames of the root-path in drive.

Desktop-connection is working and is no problem,
but after publishing my wisej web application to the webserver) google needs to authenficate by a different way with postback and redirect-uri.
And this is something i didnt need (thanks wisej) until now.

It would be great if you can support me with this, because i spend already a lot of time.

Many thanks in advance

Rupert

 

 

 

 

 

 

0 votes

Hi Marcelo,

Sorry for the delay, we are in the process of solving this case.
Thanks,

Kevin (ITG)

  • Kevin answered Jun 13, 2022 - 8:29 am
0 votes
In reply to: Google Drive

Works the same as it would work with an aspnet application. If you have a downloadable and runnable sample that shows the issue we can try to help. Attach it as a zip. It has to be a compilable visual studio solution.

  • Luca answered Jun 11, 2022 - 2:53 pm
0 votes
In reply to: Google Drive

Hi Levie,

first i will explain you what i am doing and what intention i have:

Using wisej i developed an accounting system which is used by a lot of users.
Now users should be able to digitalize their receipts.
I thought the simpliest way is, that for digtalizing of receipts users should use their private smartphones and then using the built in function ‘Scanning’ in Google Drive and store the receipts as pfd-files in their own google drive.

So far so good.

But now my central web-app has to let each user access their own google drive and they should be able to store a link to each pdf-file.

Can it be possible that no other developer needed something like this before?
I really searched a lot for some samples in the internet and found nothing.

In console.cloud.google.com you can export 2 types of json files:
One for access via Desktop-Application and
one for access via Web-Server which uses a redirect-url.

Access with the json file for Desktop-Apps is no problem and i am able to access Google Drive on my developer-PC.
But the same app does not work when i publish it to the webserver.
So i read in Google documentation that i have to use the json for Webservers and to change some Google-Api functions to

Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp and to do a request.

But i dont know how to do it  in wisej?

In my added sample code you can find this functions (unconverted as they are) with “System.Web.HttpContext.Current” namespace (how they cannot work)

Please can you help me how to do this?

Many thanks in advance.

Rupert

Because the upload of my samplecode.vb was forbidden, i insert it here:

Public Class GDriveClass
Public Service As DriveService = Nothing

Public BasePath As String = “”

Public OAuth_File_Web As String = “client-secrets-web.json”

Public ApplicationName As String = “AppName”
Public UserId As String = “UserId”
Public Scopes As String() = {DriveService.Scope.Drive}

Private Function Authenticate() As IConfigurableHttpClientInitializer
Dim clientSecrets As ClientSecrets
Dim usercredential As UserCredential
Dim googlecredential As GoogleCredential
Dim oauthfile As FileStream
Dim oauthFilePath As String
Dim token As TokenResponse
Dim flow As GoogleAuthorizationCodeFlow
Dim flowinit As Object

Try

‘Path for json-Files
If BasePath = “” Then
ErrL.Add(“TokenFileName for Json-File is not set”)
Return Nothing
End If

‘ full path and filename of json credential file for web-authorization for google drive
oauthFilePath = IIf(OAuth_File_Web <> “”, Path.Combine(BasePath, OAuth_File_Web), “”)
If oauthFilePath <> “” Then
If System.IO.File.Exists(oauthFilePath) Then
Debug.Print(“Loading Web OAuth2 credentials from ” + oauthFilePath)
oauthfile = System.IO.File.Open(oauthFilePath, FileMode.Open, FileAccess.Read)
flowinit = New GoogleAuthorizationCodeFlow.Initializer() With {
.DataStore = New FileDataStore(BasePath),
.ClientSecretsStream = oauthfile,
.Scopes = Scopes
}
flow = New GoogleAuthorizationCodeFlow(flowinit)

‘until here it works
‘but the next statements i use System.Web.HttpContext.Current which cannot work in my wisej-serverapp
‘but i dont know how do it
Dim Uri As Object = System.Web.HttpContext.Current.Request.Url.ToString()
Dim code As Object = System.Web.HttpContext.Current.Request(“code”)

If code IsNot Nothing Then
token = flow.ExchangeCodeForTokenAsync(UserId, code, Uri.substring(0, Uri.indexof(“?”)), CancellationToken.None).Result
Dim oauthState As Object = Web.AuthWebUtility.ExtracRedirectFromState(flow.DataStore, UserId, System.Web.HttpContext.Current.Request(“State”)).Result
System.Web.HttpContext.Current.Response.Redirect(oauthState)
Else
Dim result As Object = New Web.AuthorizationCodeWebApp(flow, uri, uri).AuthorizeAsync(UserId, CancellationToken.None).Result
If result.RedirectUri IsNot Nothing Then
System.Web.HttpContext.Current.Response.Redirect(result.RedirectUri)
Else
Return result.Credential
End If
End If
End If
End If

Debug.Print(“Could not find authentication credentials”)
Return Nothing
Catch ex As Exception
ErrMgr.Handler(ex)
Finally
CloseObject(oauthfile)
CloseObject(usercredential)
CloseObject(googlecredential)
CloseObject(flowinit)
CloseObject(flow)
End Try
End Function
End Class

 

 

0 votes

Hi Tung,

It appears that you’re using an old version of the Bootstrap-4 theme.

You can get the latest themes from Wisej Themes | Github, after cloning the repository please replace the existing themes in Documents\Wisej\Themes with the newer ones.

HTH,
Alaa

  • Alaa (ITG) answered Jun 10, 2022 - 3:46 pm
  • last active Jun 10, 2022 - 3:46 pm
0 votes

The sample is using Wisej 2.5. The bootstrap theme definition there had an overflow style set to visible causing the issue you see. It’s OK with the latest version of Wisej 3 and the latest Wisej 2 nuget package (2.5.37).

  • Luca answered Jun 10, 2022 - 3:38 pm
0 votes

Hi Tung,

Thank you for reporting this issue, we’re currently investigating it and we’ll get back to you ASAP!

Best,
Alaa

  • Alaa (ITG) answered Jun 10, 2022 - 1:18 pm
  • last active Jun 10, 2022 - 1:19 pm
0 votes

Hi Frank,

I just change the View property of the fullcalendar widget and change the theme in Default.json.

I tried serveral ways as you suggested, but could not make it work.

My step are simple:

1 . Create a new wisej desktop project, add fullcalendar nuget

2. Drop a full calendar widget to the window1. set dock = fill, set View = AgendaDay

3. run it and resize the window1.  The scrollbar  is not visible with bootstrap theme. It is visible with basic theme

You can check this minimum project at fullcalendar/fullcalendar at master · EricNgo1972/fullcalendar (github.com)

Please advise how to make the scrollbar appear.

 

 

TRANSLATE with
COPY THE URL BELOW
Back

EMBED THE SNIPPET BELOW IN YOUR SITE
Enable collaborative features and customize widget: Bing Webmaster Portal

// <![CDATA[
var intervalId = setInterval(function () { if (MtPopUpList) { LanguageMenu = new MtPopUpList(); var langMenu = document.getElementById(LanguageMenu_popupid); var origLangDiv = document.createElement("div"); origLangDiv.id = "OriginalLanguageDiv"; origLangDiv.innerHTML = "ORIGINAL: “; langMenu.appendChild(origLangDiv); LanguageMenu.Init(‘LanguageMenu’, LanguageMenu_keys, LanguageMenu_values, LanguageMenu_callback, LanguageMenu_popupid); window[“LanguageMenu”] = LanguageMenu; clearInterval(intervalId); } }, 1);
// ]]>

  • Tung Ngo answered Jun 9, 2022 - 10:52 pm
0 votes

Hi Adrian,

this is probably the same reason as for your other issue you have reported:

https://wisej.com/support/question/messagebox-text-size

Have you tried setting the Viewport in default.html?
It should also fix this one.

Best regards
Frank

0 votes

Hi Tung,

did you modify the sample? The way it is build originally a horizontal scrollbar should never appear
(regardless of the theme), because the calendar is set to Dock = fill in the 2nd split container panel.

Apparently in your version the docking may have been removed. In that case you´d need to set AutoScroll = true for SplitContainer.Panel2.
Plus you´d need to explicitly set the size.

Best regards
Frank

Showing 2201 - 2220 of 11k results