本文整理汇总了C#中View.InputMemberPersonalNumber方法的典型用法代码示例。如果您正苦于以下问题:C# View.InputMemberPersonalNumber方法的具体用法?C# View.InputMemberPersonalNumber怎么用?C# View.InputMemberPersonalNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View.InputMemberPersonalNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleEventNewMember
public void HandleEventNewMember(View.Console view, Model.MemberRegister register)
{
view.ShowInputInfo(View.Console.MenuEvent.AddNewMember, null);
Model.Member m = new Model.Member(register.GetNextMemberId());
try
{
m.Name = view.InputMemberName();
}
catch (ArgumentException)
{
view.ShowErrorMessage(View.Console.Error.InvalidMemberName, null);
view.Wait();
return;
}
try { m.PersonalNumber = view.InputMemberPersonalNumber(); }
catch (ArgumentException)
{
view.ShowErrorMessage(View.Console.Error.InvalidPersonalNumber, null);
view.Wait();
return;
}
register.AddMember(m);
register.Save();
}
示例2: HandleEventShowMemberInfoMenu
public void HandleEventShowMemberInfoMenu(Model.Member member, View.Console view, Model.MemberRegister register)
{
while (true)
{
view.ShowMenu(View.Console.MenuEvent.MemberInfoMenu, member);
switch (view.GetMenuSelection())
{
case View.Console.MenuEvent.EditMemberName:
view.ShowInputInfo(View.Console.MenuEvent.EditMemberName, member);
try
{
member.Name = view.InputMemberName();
register.Save();
}
catch (ArgumentException)
{
view.ShowErrorMessage(View.Console.Error.InvalidMemberName, null);
view.Wait();
}
break;
case View.Console.MenuEvent.EditMemberPersonalNumber:
view.ShowInputInfo(View.Console.MenuEvent.EditMemberPersonalNumber, member);
try
{
member.PersonalNumber = view.InputMemberPersonalNumber();
register.Save();
}
catch (ArgumentException)
{
view.ShowErrorMessage(View.Console.Error.InvalidPersonalNumber, null);
view.Wait();
}
break;
case View.Console.MenuEvent.ManageBoatsMenu:
HandleEventShowManageBoatsMenu(member, view, register);
register.Save();
break;
case View.Console.MenuEvent.Back:
// exit menu.
return;
}
}
}