public User(String UserId, String Password, String ProgramId) { _Info = Retrieve(UserId); if (_Info.HasRows()) { InitializeProperties(_Info.Rows[0]); if (Password != _Password) { throw new Exception("Access Denied."); } Role roles = new Role(_UserID, ProgramId); _Roles = (IRole)roles; if (!_Roles.UserRoles.HasRows()) { throw new Exception("Access Denied.\n\nYou don't have permission to access the program."); } WarehouseDesignation warehouseDesignation = new WarehouseDesignation(_UserID); _WarehouseDesignation = (IWarehouseDesignation)warehouseDesignation; } else { throw new KeyNotFoundException("User ID not found."); } }
public Employee(Int32 Id) { _Info = Retrieve(Id); if (_Info.HasRows()) { InitializeProperties(_Info.Rows[0]); ReportingDepartment reportingDepartments = new ReportingDepartment(_ResourceID); _ReportingDepartment = reportingDepartments; WarehouseDesignation warehouseDesignation = new WarehouseDesignation(_EmployeeId); _WarehouseDesignation = (IWarehouseDesignation)warehouseDesignation; } else { throw new KeyNotFoundException("Id not found."); } }
public void Retrieve() { _Info = EmployeeDac.Retrieve(this).Tables[0]; if (_Info.HasRows()) { InitializeProperties(_Info.Rows[0]); ReportingDepartment reportingDepartments = new ReportingDepartment(_ResourceID); _ReportingDepartment = reportingDepartments; WarehouseDesignation warehouseDesignation = new WarehouseDesignation(_EmployeeId); _WarehouseDesignation = (IWarehouseDesignation)warehouseDesignation; } else { throw new KeyNotFoundException("Email not found."); } }
public User(String UserId) { _Info = Retrieve(UserId); if (_Info.HasRows()) { InitializeProperties(_Info.Rows[0]); Role roles = new Role(_UserID); _Roles = (IRole)roles; WarehouseDesignation warehouseDesignation = new WarehouseDesignation(_UserID); _WarehouseDesignation = (IWarehouseDesignation)warehouseDesignation; } else { throw new KeyNotFoundException("User ID not found."); } }