Ejemplo n.º 1
0
        public void Menu()
        {
            Console.OutputEncoding = Encoding.UTF8;
            Console.Clear();
            bool exit = false;

            string[] menu =
            {
                "1.Quản lý phân công",
                "2.Quản lý lớp",
                "3.Quản lý học phần",
                "4.Quản lý giảng viên",
                "5.Quản lý chuyên ngành",
                "5.Đổi mật khẩu",
                "6.Dang Xuat"
            };
            MenuSelector menuSelector = new MenuSelector(menu, "Quản lý giảng dạy cho trưởng bộ môn");

            while (!exit)
            {
                int     mode = menuSelector.Selector();
                IUIable UI   = GetUI(mode);
                if (UI is LoginUI)
                {
                    LoginUI loginUI = new LoginUI();
                    loginUI.Logout();
                }
                else
                {
                    UI.Menu();
                }
            }
        }
Ejemplo n.º 2
0
 public IconInfo(string name, Sprite icon, IUIable source = null, IconInfo[] details = null)
 {
     this.source  = source;
     this.name    = name;
     this.icon    = icon;
     this.details = details;
 }
Ejemplo n.º 3
0
        public void Menu()
        {
            Console.OutputEncoding = Encoding.UTF8;
            Console.Clear();
            bool exit = false;

            string[] menu =
            {
                "1.Quản lý giảng viên",
                "2.Thay đổi thông tin đăng nhập",
                "3.Quản lý lớp học",
                "4.Quản lý bộ môn",
                "5.Quản lý chuyên ngành",
                "6.Quản lý học phần",
                "7.Đăng xuất"
            };

            while (!exit)
            {
                MenuSelector selector = new MenuSelector(menu, "Quản lý giảng dạy cho Admin");
                int          mode     = selector.Selector();
                IUIable      UI       = GetUI(mode);
                if (UI is LoginUI)
                {
                    LoginUI loginUI = new LoginUI();
                    loginUI.Logout();
                }
                else
                {
                    UI.Menu();
                }
            }
        }
Ejemplo n.º 4
0
        public void Login()
        {
            Console.Clear();
            Console.CursorVisible  = true;
            Console.OutputEncoding = Encoding.UTF8;
            while (true)
            {
                MessageBox messageBox = new MessageBox(30, 10, 10, "Đăng nhập");
                messageBox.Draw();

                Console.CursorLeft = messageBox.PaddingLeft + 3;
                Console.CursorTop  = (messageBox.Height + messageBox.PaddingTop) - 7;
                Console.Write("Tài khoản: ");

                Console.CursorLeft = messageBox.PaddingLeft + 3;
                Console.CursorTop += 3;
                Console.Write("Mật Khẩu: ");

                Console.CursorTop -= 3;
                Console.CursorLeft = messageBox.PaddingLeft + 3 + "Tài khoản: ".Length;
                string account = Console.ReadLine();

                Console.CursorTop += 2;
                Console.CursorLeft = messageBox.PaddingLeft + 3 + "Mật khẩu: ".Length;
                string password = Console.ReadLine();
                User   user     = userable.Login(account, password);
                if (user != null)
                {
                    IUIable UI = LoginHandler.GetUI(user);
                    UI.Menu();
                    break;
                }
                else
                {
                    Console.Clear();
                    MessageBox box = new MessageBox(50, 5, Console.CursorTop + 5, "Lỗi đăng nhập");
                    box.Draw();
                    Console.CursorLeft = box.PaddingLeft + 3;
                    Console.CursorTop  = Console.CursorTop - 3;
                    Console.WriteLine("Mật khẩu hoặc tài khoản không đúng");
                    Thread.Sleep(1000);
                    Console.Clear();
                    Login();
                }
            }
        }
Ejemplo n.º 5
0
 public virtual void Start()
 {
     m_Renderer = gameObject.GetComponent <MeshRenderer>();
     if (!m_Renderer)
     {
         m_Renderer = gameObject.GetComponentInChildren <MeshRenderer>();
     }
     if (!m_Renderer)
     {
         m_Renderer = gameObject.GetComponentInParent <MeshRenderer>();
     }
     if (!m_Renderer)
     {
         Debug.LogWarning("spaceIcon couldnt get m_Renderer  " + m_Renderer);
     }
     uiable = gameObject.GetComponentInParent <IUIable>();
     if (uiable == null)
     {
         Debug.LogWarning("spaceIcon couldnt get uiable  " + uiable);
     }
 }
Ejemplo n.º 6
0
 public void set(IUIable infoable)
 {
     obj = infoable;
     Debug.Log("SET SPACEABLE ICON");
     mesh.materials[0].mainTexture = obj.getIconableInfo().icon.texture;
 }