Пример #1
0
        static void Main(string[] args)
        {
            unityContainer = new UnityContainer();
            UnityConfig.Initialize(unityContainer);
            CurrentUserInfo.sessionTokenInfo = unityContainer.Resolve <Authorization>("authorization").Authorize();



            if (CurrentUserInfo.sessionTokenInfo != null)
            {
                switch (CurrentUserInfo.sessionTokenInfo.Role)
                {
                case "Admin":
                    Console.WriteLine("Роль администратор");
                    var adminService = unityContainer.Resolve <Admin>();
                    adminService.ChooseOperation();
                    break;

                case "User":
                    Console.WriteLine("Медрегистратор");
                    var receptionServise = unityContainer.Resolve <Reseption>();
                    receptionServise.ChooseOperation();
                    break;

                default:
                    break;
                }
            }
        }
Пример #2
0
 public MainActivity()
 {
     UnityConfig.Initialize();
 }