📄 guestmanager.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Hotel.Guest.Bll
{
public class GuestManager
{
/// <summary>
/// </summary>
private ArrayList _myGU;
/// <summary>
/// 团队数量统计
/// </summary>
public GuestBase Find(string teamId)
{
foreach (GuestBase var in _myGU)
{
if (var is Team)
{
Team tm = new Team();
tm = (Team)var;
if (tm.Name == teamId)
return tm;
}
else
{
Customer tm = new Customer();
tm=(Customer)var;
if (tm.Name == teamId)
return tm;
}
}
return null;
}
public GuestBase Find(int index)
{
GuestBase gb = new GuestBase();
_myGU.IndexOf(gb, index);
return gb;
}
public Int32 GetTeamCount()
{
return TeamCount();
}
public Int32 GetCustomerCount()
{
return CustomerCount();
}
public Int32 GetCountPeason()
{
return PeasonCount();
}
private Int32 CustomerCount()
{
Int32 count = 0;
foreach (GuestBase var in _myGU)
{
if (var is Customer)
{
count++;
}
}
return count;
}
private Int32 TeamCount()
{
Int32 count = 0;
foreach (GuestBase var in _myGU)
{
if (var is Team)
{
count++;
}
}
return count;
}
private Int32 PeasonCount()
{
Int32 count = 0;
foreach (GuestBase var in _myGU)
{
if (var is Team)
{
Team tm = new Team();
tm = (Team)var;
count+=tm.Count;
}
else
{
count++;
}
}
return count;
}
/// <summary>
/// 所有客人统计
/// </summary>
private Int32 _Count;
public int Count
{
get { return _myGU.Count; }
}
public void Add(GuestBase gu)
{
if (_myGU == null)
{
_myGU = new ArrayList();
}
_myGU.Add(gu);
}
public GuestManager()
{
//_myGU = new ArrayList();
//LoadData();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -