// Loads a users info
public void loadUserInfo()
{
CrystalTech.tblUsersDataTable dsCommon = new CrystalTech.tblUsersDataTable();
using (tblUsersTableAdapter userAdapter = new tblUsersTableAdapter())
{
userAdapter.FillBy(dsCommon, this.ID);
}
this.username = dsCommon[0].userName;
this.company.ID = dsCommon[0].clientID;
this.company.name = dsCommon[0].ClientName;
this.isBuyer = bool.Parse(dsCommon[0].isBuyer.ToString());
this.isClient = bool.Parse(dsCommon[0].isClient.ToString());
this.isClientPowerUser = bool.Parse(dsCommon[0].powerUser.ToString());
this.isReportingUser = bool.Parse(dsCommon[0].reportingUser.ToString());
this.isSupplier = bool.Parse(dsCommon[0].isSupplier.ToString());
this.isPaperSupplier = bool.Parse(dsCommon[0].isPaperSupplier.ToString());
this.hasKitView = bool.Parse(dsCommon[0].haskitview.ToString());
}
public void loadUserInfo(int usersID)
{
this.ID = usersID;
loadUserInfo();
}
Is this correct/standard? Or am I approaching this incorrectly? The aim is to have the usersID passed in an optional parameter.
Firstly what you have done is
method overloading,overridingis something completely different. Assuming it is method overloading you are after and the name of the parametered method is a simple typo, then yes that is how you do it.