本文整理汇总了C#中IUserRepository.IsManager方法的典型用法代码示例。如果您正苦于以下问题:C# IUserRepository.IsManager方法的具体用法?C# IUserRepository.IsManager怎么用?C# IUserRepository.IsManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUserRepository
的用法示例。
在下文中一共展示了IUserRepository.IsManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessManager
private static void ProcessManager(IUserRepository userRepo)
{
var mgrDetails = userRepo.IsManager(_userId);
if (mgrDetails.Key)
{
IsUserManager = true;
_department = mgrDetails.Value;
System.Console.WriteLine("You are manager of department : " + _department + MainMenu.GetNewLine());
System.Console.ReadLine();
var input = ManagerMenu.ShowManagerMenu(UserName, _department);
while (!string.IsNullOrEmpty(input))
{
switch (input)
{
case "1":
System.Console.WriteLine("You can see the logs @ " + ConfigHelper.GetLogPath());
break;
case "2":
var accessPoints = _AccessPointRepository.Get();
foreach (var ap in accessPoints)
{
System.Console.WriteLine("{0} | {1} | {2}", ap.Id, ap.Name, ap.Facility.Name);
}
break;
case "3":
System.Console.WriteLine("To grant user access, enter <AccessPointId> <EmployeeId> <access/manage/monitor>");
var data = System.Console.ReadLine().Split(' ');
if (data.Length != 3)
System.Console.WriteLine("Invalid details");
else
{
_AccessPointFacade.InsertUserAccess(data[1], data[0], data[2]);
}
break;
default:
System.Console.WriteLine("Invalid input!");
break;
}
System.Console.WriteLine(MainMenu.GetNewLine() + "Press `Enter` to continue..");
System.Console.ReadLine();
input = ManagerMenu.ShowManagerMenu(UserName, _department);
}
}
else
IsUserManager = false;
}