473,287 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Parameter question

Hi

I have a class that have a Login Method that opens a Login Form
The client that calls the Login Method should receive the User_ID if logins succed
Is it possible to return from the Login form to the method the UserID and from the method to the client

//THIS IS THE LOGIN METHOD THAT WILL CALL THE LOGIN FOR
public string GUILogin(string sDBUser, string sDBPassw, string sDBDsn

Form oform=new dlgLogin(sDBUser, sDBPassw, sDBDsn, ref ID_Util)
oform.ShowDialog()
// CAN I CATCH HERE THE USERID STORED IN A FORM VARIABLE OR SOMETHING LIKE THAT
Thanks for your help
Bernardo Piano
Nov 15 '05 #1
3 1167
"Bernardo" <bp****@sapo.pt> wrote in message
news:C3**********************************@microsof t.com...
Hi,

I have a class that have a Login Method that opens a Login Form.
The client that calls the Login Method should receive the User_ID if logins succed. Is it possible to return from the Login form to the method the UserID and from the method to the client?
//THIS IS THE LOGIN METHOD THAT WILL CALL THE LOGIN FORM
public string GUILogin(string sDBUser, string sDBPassw, string sDBDsn)
{
Form oform=new dlgLogin(sDBUser, sDBPassw, sDBDsn, ref ID_Util);
oform.ShowDialog();
// CAN I CATCH HERE THE USERID STORED IN A FORM VARIABLE OR SOMETHING LIKE THAT? }

Thanks for your help,
Bernardo Piano


If dlgLogin is your own class, just implement a property containing the user
ID as entered by the user.
So in the dlgLogin form something like,
public string UserID
{
get
{
return (UserIDInputControl).Text;
}
}

Then in the login method, read it like
userID = oform.UserID;

Is that what you're looking for?

Eric

Nov 15 '05 #2
Hi,

You can declare a property in the dlgLogin class that contain the userID ,
you will have to check if the login was not succesful and something about
it.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Bernardo" <bp****@sapo.pt> wrote in message
news:C3**********************************@microsof t.com...
Hi,

I have a class that have a Login Method that opens a Login Form.
The client that calls the Login Method should receive the User_ID if logins succed. Is it possible to return from the Login form to the method the UserID and from the method to the client?
//THIS IS THE LOGIN METHOD THAT WILL CALL THE LOGIN FORM
public string GUILogin(string sDBUser, string sDBPassw, string sDBDsn)
{
Form oform=new dlgLogin(sDBUser, sDBPassw, sDBDsn, ref ID_Util);
oform.ShowDialog();
// CAN I CATCH HERE THE USERID STORED IN A FORM VARIABLE OR SOMETHING LIKE THAT? }

Thanks for your help,
Bernardo Piano

Nov 15 '05 #3

Hi, Bernardo!

I have a class that have a Login Method that opens a Login Form.
The client that calls the Login Method should receive the User_ID if logins succed. Is it possible to return from the Login form to the method the UserID and from the method to the client?
//THIS IS THE LOGIN METHOD THAT WILL CALL THE LOGIN FORM
public string GUILogin(string sDBUser, string sDBPassw, string sDBDsn)
{
Form oform=new dlgLogin(sDBUser, sDBPassw, sDBDsn, ref ID_Util);
oform.ShowDialog();
// CAN I CATCH HERE THE USERID STORED IN A FORM VARIABLE OR SOMETHING LIKE THAT? }


Use this sample code:
namespace App.UI
{
public class FormLogin : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button_Accept;
private System.Windows.Forms.Button button_Cancel;
private System.Windows.Forms.TextBox UserID;
private System.Windows.Forms.TextBox Password;

#region Windows Form Designer generated code
...
#endregion

public static DialogResult ShowDialog(out string UserID, out string
Password, IWin32Window owner)
{
DialogResult ret;
FormLogin frm = new FormLogin();
ret = frm.ShowDialog(owner);
UserID = frm.UserID.Text;
Password = frm.Password.Text;
return ret;
}

public static DialogResult ShowDialog(out string UserID, out string
Password)
{
DialogResult ret;
FormLogin frm = new FormLogin();
ret = frm.ShowDialog();
UserID = frm.UserID.Text;
Password = frm.Password.Text;
return ret;
}
}
}
--
Roman S. Golubin
ICQ UIN 63253392
go*****************@arhcity.ru
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
1
by: Prashanth | last post by:
Hi , I want to make a stored proc call thru .NET . I use the SqlParameter objects to create input parameters and set it's value. SqlParameter myParameter = new...
3
by: Aguilar, James | last post by:
Hey all. I was making a newbie mistake that I eventually figured out. That is not my question. My question is about the error message. So let me set the stage for you: class Superclass {...
3
by: thomas goodwin | last post by:
I have a query which asks for a parameter value to execute it. To see the results I have to: a) click on the query -- the "Enter Parameter Value" window pops up. b) enter the parameter value c)...
6
by: hecsan07 | last post by:
I am writing some code that passes two parameters to a store procedure. One of the parameters is an output parameter. I am querying the DB using the input value and returning a field from the...
7
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex...
12
by: Darwin Lalo | last post by:
I have a lot of code like this: VOID CALLBACK TimerRoutine(PVOID lpParam) { long nTaskid = (long)lpParam; GObj *obj; if( mapThreadSafe.find( nTaskid, obj )) // mapThreadSafe is a hash_map,...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
4
by: David Sanders | last post by:
Hi, I have a class with an integer template parameter, taking values 1, 2 or 3, and a function 'calc' in that class which performs calculations. Some calculations need only be performed if the...
6
by: HillBilly | last post by:
One question I have not figured out is how to learn which event parameter list is supported by a control? EventArgs, CommandEventArgs, what?
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.