Click here to Skip to main content
16,016,290 members

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");
}

}