public void Login(bool isCustomer, string email, string psw, uxLoginScreen login)
 {
     _LogScreen = login;
     if (!isCustomer) // Admin
     {
         _commandText = "GetAdminLogins";
         int UserId = AccountLogin(email, psw);
         if (UserId != -1) // Valid
         {
             AdminGUI adminGui = new AdminGUI(login);
             adminGui.Show();
             _LogScreen.Hide();
         }
     }
     else if (isCustomer) // Customer
     {
         _commandText = "dbo.GetCustomerLogins";
         int UserId = AccountLogin(email, psw);
         if (UserId != -1)  // valid
         {
             Form1Controller controller = new Form1Controller(UserId);
             uxCustomerUI    customerUI = new uxCustomerUI(controller.Showtimes, controller.History, controller.GetMovieList, controller.GetTheaterList, login);
             controller.UpdateMovies(customerUI.UpdateMovie);
             controller.UpdateTheater(customerUI.UpdateTheater);
             customerUI.Show();
             _LogScreen.Hide();
         }
     }
 }
示例#2
0
 public uxCustomerUI(ShowShowtimeDel showdel, ShowHistoryDel histdel, ShowMoviesDel moviesdel, ShowTheatersDel theatersDel, uxLoginScreen loginScreen)
 {
     showShowtimeHandler = showdel;
     showHistoryHandler  = histdel;
     showMoviesHandler   = moviesdel;
     showTheaterHandler  = theatersDel;
     this.loginScreen    = loginScreen;
     InitializeComponent();
 }
示例#3
0
 public AdminGUI(uxLoginScreen login)
 {
     loginScreen = login;
     InitializeComponent();
     movieL          = new List <string>();
     theaterL        = new List <string>();
     locationL       = new List <string>();
     movienames      = new List <string>();
     theaternames    = new List <string>();
     theaterLocation = new List <string>();
     updateMovieTable();
     updateTheaterTable();
     updateShowingTable();
 }
示例#4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logdel"></param>
 /// <param name="log"></param>
 public CreateAccount(LoginDel log, uxLoginScreen screen)
 {
     _logdel    = log;
     _logscreen = screen;
     InitializeComponent();
 }