C# and MS access
can i talk to anyone about my project in C# and MS and to explain it in details i have just few problem about some code i don't know how to used.. and also to send my project?? so i show full project?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kunal VaishyaPosted May 14, 2012, 1:45 AM
firstly you should read about all C# syntax
use == for comparing
==
if(combobox1.Text == "employee")
{
// to make these forms invisible for him like
MDIparent.MasterToolStripMenuItem.Visible = false;
MDIparent.EmployeeToolStripMenuItem.Visible = false;
MDIparent.SearchToolStripMenuItem.Visible = false;
MDIparent.LeaveToolStripMenuItem.Visible = false;
MDIparent.EarnToolStripMenuItem.Visible = false;
MDIparent.DeductionToolStripMenuItem.Visible = false;
MDIparent.events.Visible = false;
}
second as per your you want to set dynamic Menu rights as per employee ok so
try this if get any problem then let me know the code so we can help you
ali saadPosted May 13, 2012, 6:45 PM
i created Ms access
user{UserId, userType, Username, userpass}
employee{Employeeid, employeecde, employeepass,......etc}
and i created a login form contain {combobox to chose if the user is admin or employee}
and two textBoxes for username and password ..
so i conected to my database(both of admin and user can access a MDIParent(admin, departments, salary, attendance, ...etc) after login ) BUT for the employee when he login, the i want to write if statment for employee like if(combobox="employee")
{
to make these forms invisible for him
like
MDIparent.MasterToolStripMenuItem.Visible = false;
MDIparent.EmployeeToolStripMenuItem.Visible = false;
MDIparent.SearchToolStripMenuItem.Visible = false;
MDIparent.LeaveToolStripMenuItem.Visible = false;
MDIparent.EarnToolStripMenuItem.Visible = false;
MDIparent.DeductionToolStripMenuItem.Visible = false;
MDIparent.events.Visible = false;
}
but i tried with it alot and i couldn't solve it :(
Mahesh ChandPosted May 13, 2012, 6:03 PM