
CCH4UNIGUI
Members-
Content Count
44 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout CCH4UNIGUI
-
Rank
Newbie
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
How to check value of Public variable assigned in LoginForm at MainModule
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
This issue is resolved 🙂 -
Solved. Will work on MainForm.OnCreate event
-
FYI, actual codes procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); begin EmployeeTable.Active:=False; //opened but no data EmployeeTable.CommandText:='select * from employee WHERE ID='''+ cUserName+'''' ; //works perfectly EmployeeTable.CommandText:='select * from employee WHERE ID='''+ '8180'+'''' ; //opened but no data EmployeeTable.CommandText:='select * from employee WHERE ID='+QuotedStr(cUsername) ; EmployeeTable.CommandText:='select * from employee WHERE ID='+cUsername ; EmployeeTable.Active:=True; end;
-
Hi Sherzod In MainModule: EmployeeTable.CommandText:='select * from employee WHERE ID='''+ '8180'+'''' <Works perfectly ie EmployeeTable opens and only data where id=8180 is shown> In LoginForm: UniMainModule.cUsername:=UserNameUniEdit.Text; <input as 8180 & value verified in MainForm as 8180> <cUsername declared as public in MainModule> Problem in MainModule EmployeeTable.CommandText:='select * from employee WHERE ID='''+ cUserName+'''' <EmployeeTable opens with no data> EmployeeTable.CommandText:='select * from emp
-
BUG ? Public variable from TUniLoginForm1 is not visible in MainForm
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
TQ. Have used a TUnilabel.caption on MainForm to verify the cUserId input. -
BUG ? Public variable from TUniLoginForm1 is not visible in MainForm
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
Hi Sherzod I understand the concept in the LoginForm but what I want to do is simple. Once logged in, I want to use the User ID to be used to filter to only show data belonging to the logged in UserId. How do I do that ? -
BUG ? Public variable from TUniLoginForm1 is not visible in MainForm
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
Hi Ron I understand the concept as above but what I want to do is simple. Once logged in, I want to use the User ID to be used to filter to only show data belonging to the logged in UserId. How do I do that ? -
Hi Farshad/Sherzod 1. Started new project 2. Added LoginForm via Unigui Wizard 3. Added UniEdit1: TUniEdit; 4. Declared cUserID: string as public 5. Input UniEdit1.Text=8180 in Login Form 5. cUserID:=trim(UniEdit1.Text) ; 6. Press OK to proceed to MainForm 7. ShowMessage( cUserID) in MainForm shows no value (expect to see 8180) Q. Why is public variable cUserID not visible in MainForm ? How can I make public variable cUserID visible in MainForm ? Actual Project Codes unit Login; interface uses Windows, Messages, Sys
-
How to pass user input from UniGui Login Form to MainModule
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
There is nothing wrong with your suggested SQL syntax, I have identified the problem. The basic problem is that cUserName:=trim(UserNameUniEdit.Text) in the UniLoginForm , though declared as public is NEVER passed to Main.pass -
How to pass user input from UniGui Login Form to MainModule
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
public { Public declarations } cUserName:string; cUserNameID:integer; cUsernameID:=StrToIntDef(trim(UserNameUniEdit.Text),0) ; <compile ok> EmployeeTable.CommandText:='select * from employee WHERE ID='+cUsernameID ; <D10.3.3 complains incompatible types 'string ' and 'integer'> -
How to pass user input from UniGui Login Form to MainModule
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
Hi U are right, id is integer. But cUsername:=trim(UserNameUniEdit.Text); -
Hi Sherzod I have a simple login form created via Uniform Form wizard and 1. assign as public cUsername:string 2. cUsername:=trim(UserNameUniEdit.Text); eg 8180 I checked the value via showmessage at LoginForm and confirm as 8180 But I suspect that though declared as public in both loginForm & MainModule, cUserName is no longer 8180 at MainModule Q. How can I check the value of cUserName at MainModule as showmessage don't work there Please revert. TQ Actual Codes unit login; interface uses Windows, Messages, SysUtils
-
How to pass user input from UniGui Login Form to MainModule
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
EmployeeTable.CommandText:='select * from employee WHERE ID='+ QuotedStr(cUserName) ; Hi epos4u Can compile but have same effect as EmployeeTable.CommandText:='select * from employee WHERE ID='''+ cUserName+'''' ; ie EmployeeTable opens but no data shown. Beginning to suspect the value of cUserName is not 8180 though 8180 is input Can compile but have the same effect as Thanks for the speedy response. -
How to pass user input from UniGui Login Form to MainModule
CCH4UNIGUI replied to CCH4UNIGUI's topic in General
Hi Ron Your suggestion can compile but the Employeetable is not opened at all 😞 -
I have a simple login form created via Uniform Form wizard unit login; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIRegClasses, uniGUIForm, uniButton, uniPanel, uniEdit, uniGUIBaseClasses, uniLabel; type TUniLoginForm1 = class(TUniLoginForm) UniLabel1: TUniLabel; UserNameUniEdit: TUniEdit; UniLabel2: TUniLabel; UniEdit2: TUniEdit; UniPanel1: TUniPanel; OKUniBtn: TUniButton; CancelUniBtn: TUniButton; procedu