本文整理汇总了C#中Staff.GetOfficeNo方法的典型用法代码示例。如果您正苦于以下问题:C# Staff.GetOfficeNo方法的具体用法?C# Staff.GetOfficeNo怎么用?C# Staff.GetOfficeNo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff.GetOfficeNo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContainsStaff
/// <summary>
/// Determins if the staff list contains the staff.
/// </summary>
/// <returns><c>true</c>, if staff exists, <c>false</c> otherwise.</returns>
/// <param name="s">S.</param>
public bool ContainsStaff(Staff s)
{
bool contains = false;
if(mStaff.Count > 0)
{
for (int i=0; i<mStaff.Count; i++)
{
if(mStaff[i].GetName().Equals(s.GetName()) && ( mStaff[i].GetOfficeNo().Equals(s.GetOfficeNo()))
&& ( mStaff[i].GetBuildingNo().Equals(s.GetBuildingNo())))
{
contains = true;
break;
}
}
}
return contains;
}
示例2: Staff
/// <summary>
/// Initializes a new instance of the <see cref="Staff"/> class.
/// </summary>
/// <param name="s">S.</param>
public Staff(Staff s)
{
mName = s.GetName ();
mBuildingNo = s.GetBuildingNo ();
mOfficeNo = s.GetOfficeNo ();
mEmail = s.GetEmail ();
mPhoto = s.GetPhoto ();
mPosition = s.GetPosition ();
mPhones = new List<string> ();
mOrganisations = new List<string> ();
for(int i=0; i<s.NumberOfPhones(); i++)
{
this.AddPhone(s.GetPhoneAt(i));
}
for(int i=0; i<s.NumberOfOrganisations(); i++)
{
this.AddOrganisation(s.GetOrganisationAt(i));
}
}
示例3: RemoveStaff
/// <summary>
/// Removes the staff.
/// </summary>
/// <returns><c>true</c>, if staff was removed, <c>false</c> otherwise.</returns>
/// <param name="s">S.</param>
public bool RemoveStaff(Staff s)
{
bool removed;
int startSize = mStaff.Count;
for (int i=0; i<mStaff.Count; i++)
{
if(mStaff[i].GetName().Equals(s.GetName()) && ( mStaff[i].GetOfficeNo().Equals(s.GetOfficeNo()))
&& ( mStaff[i].GetBuildingNo().Equals(s.GetBuildingNo())))
{
mStaff.RemoveAt(i);
break;
}
}
if(mStaff.Count < startSize)
removed = true;
else
removed =false;
return removed;
}