16,016,290 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MichaelSmith2017 (Top 1 by date)
MichaelSmith2017
12-Jan-18 21:19pm
View
@OriginalGriff:
I have investigated the code further and found out that the Function "SSR_SetUserInfo" returns a Boolean Value so i have made a change in the code of button "btn_WriteData_Click". I have now stored the boolean value in a variable "result" and added code for successful write operation which is a MessageBox which displays "Result Stored in the Device" in Case returned Boolean value is "True" or otherwise (as shown below). When i now click this button i get the message "Result Stored in the Device" so i believe data has been stored in the device. I also made similar changes to the code of button "btn_ReadData_Click"(as shown below) and found similar results so i believe read operation is also a success.
Now, i need to display data on the form when the second button "btn_ReadData_Click" is clicked. Can you guide me what should i add in the code of "btn_ReadData_Click"?
Best Regards
MS
private void btn_WriteData_Click(object sender, EventArgs e)
{
int MachineNumber = 1;
string EnrollNumber = "1";
string Name = "Mich";
string Password = "123";
int Privilege = 1;
bool Enabled = true;
bool result = objZkeeper.SSR_SetUserInfo(MachineNumber, EnrollNumber, Name, Password, Privilege, Enabled);
if (result == true)
{
MessageBox.Show("Result Stored in the Device");
}
else
{
MessageBox.Show("Result Not Stored in the Device");
}
}
private void btn_ReadData_Click(object sender, EventArgs e)
{
int MachineNumber = 1;
string EnrollNumber = "1";
string Name = "";
string Password = "";
int Privilege = 0;
bool Enabled = true;
bool result = objZkeeper.SSR_GetUserInfo(MachineNumber, EnrollNumber, out Name, out Password, out Privilege, out Enabled);
if (result == true)
{
MessageBox.Show("Result Retrieved");
}
else
{
MessageBox.Show("Result Not Retrieved");
}
}