Exemple #1
0
        /*void spchrec_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
         * {
         *  switch (e.Result.Text)
         *  {
         *      case "first":
         *          spchsint.SpeakAsync("Please enter your name: ");
         *          Thread.Sleep(2000);
         *          if (spchrec.AudioState != AudioState.Speech)
         *          {
         *              spchrec.RequestRecognizerUpdate();
         *          }
         *          EnterName.Focus();
         *          break;
         *      case "second":
         *          spchsint.SpeakAsync("Please enter your surname: ");
         *          Thread.Sleep(2000);
         *          if (spchrec.AudioState != AudioState.Speech)
         *          {
         *              spchrec.RequestRecognizerUpdate();
         *          }
         *          EnterSurname.Focus();
         *          break;
         *      case "user":
         *          spchsint.SpeakAsync("Please enter your username: "******"email":
         *          spchsint.SpeakAsync("Please enter your email: ");
         *          Thread.Sleep(2000);
         *          if (spchrec.AudioState != AudioState.Speech)
         *          {
         *              spchrec.RequestRecognizerUpdate();
         *              Thread.Sleep(2000);
         *          }
         *          EnterEmail.Focus();
         *          break;
         *      case "password":
         *          spchsint.SpeakAsync("Please enter your password: "******"repeat password":
         *          spchsint.SpeakAsync("Please reenter the password: "******"admin":
         *          Admin_Cod administrator = new Admin_Cod();
         *          administrator.Show();
         *          this.Close();
         *          spchrec.RecognizeAsyncStop();
         *          spchsint.Pause();
         *          break;
         *  }
         * }*/

        public void ShowMainWindow(utilizator user)
        {
            Rooms.MainWindow mainWindow = new MainWindow();
            mainWindow.SetUser(user);
            mainWindow.Show();
            this.Close();
        }
Exemple #2
0
        private void LoginBtn_Click(object sender, RoutedEventArgs e)
        {
            Rooms.LoginRegister.Login login = new LoginRegister.Login();
            string email    = textBoxEmail.Text;
            string password = passwordBox1.Password.ToString();


            try
            {
                utilizator           loggedUser           = login.Verificare_User(email, password);
                AdminFormularService adminFormularService = new AdminFormularService();

                student = adminFormularService.GetStudent(loggedUser.id);

                if (loggedUser.Role.ToString().Equals("Membru"))
                {
                    StudentModule mainWindow = new StudentModule(loggedUser, student);
                    mainWindow.Show();
                    this.Close();
                }
                else if (loggedUser.Role.ToString().Equals("Administrator"))
                {
                    AdminModule mainWindowAdmin = new AdminModule(loggedUser);
                    mainWindowAdmin.Show();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                textBoxEmail.Clear();
                passwordBox1.Clear();
                MessageBox.Show(ex.Message);
            }
        }
Exemple #3
0
        public void ShowMainWindow(utilizator user)
        {
            StudentModule mainWindow = new StudentModule(user, student);

            mainWindow.SetUser(user);
            mainWindow.Show();
            this.Close();
        }
Exemple #4
0
        public StudentModule(utilizator Utilizator, student student)

        {
            InitializeComponent();
            this.Utilizator  = Utilizator;
            this.student     = student;
            this.DB.Content  = this.Utilizator.firstname;
            this.DataContext = this;
            ShowFormStats();
        }
        public MainWindowAdmin(utilizator Utilizator)
        {
            InitializeComponent();

            this.Utilizator  = Utilizator;
            this.DB.Content  = this.Utilizator.firstname;
            this.DataContext = this;

            InitializeazFormulare();
        }
Exemple #6
0
        public Register_Student()
        {
            InitializeComponent();
            utilizator = new utilizator();


            // SqlConnection con = new SqlConnection("Data Source=ZEROLEGION\\SQLEXPRESS;Initial Catalog=Rooms404Last; integrated security=SSPI");
            Choices commands = new Choices();

            commands.Add(new string[] { "first", "second", "user", "email", "password", "repeat password", "admin" });
            GrammarBuilder gbuilder = new GrammarBuilder();

            gbuilder.Append(commands);
            Grammar grammar = new Grammar(gbuilder);

            /* spchrec.LoadGrammarAsync(grammar);
             * spchrec.SetInputToDefaultAudioDevice();
             * spchrec.SpeechRecognized += spchrec_SpeechRecognized;
             * spchrec.RecognizeAsync(RecognizeMode.Multiple);
             * // spchsint.Rate = -3;
             * //  spchsint.Volume = 10;*/
        }
Exemple #7
0
 public void SetUser(utilizator utilizator)
 {
     Debug.WriteLine("set user: user = "******" user id = " + utilizator.id);
     this.Utilizator = utilizator;
 }
Exemple #8
0
        private void RegisterBtn_Click_1(object sender, RoutedEventArgs e)
        {
            Rooms.LoginRegister.Register register = new LoginRegister.Register();
            string username        = EnterUsername.Text;
            string password        = EnterPassword.Password.ToString();
            string confirmpassword = ConfirmPassword.Password.ToString();
            string firstname       = EnterName.Text;
            string lastname        = EnterSurname.Text;

            bool checkInstructor;

            if (InstructorRadioBtn.IsChecked == true)
            {
                checkInstructor = true;
            }
            else
            {
                checkInstructor = false;
            }


            string email = EnterEmail.Text;

            utilizator.username  = username;
            utilizator.password  = password;
            utilizator.firstname = firstname;
            utilizator.lastname  = lastname;
            utilizator.email     = email;
            utilizator.Role      = InstructorRadioBtn.IsEnabled ? Rol_Utilizator.Membru : Rol_Utilizator.Administrator;

            try
            {
                utilizator newUser = register.Valideaza_Inregistrare(username, password, firstname, lastname, confirmpassword, checkInstructor, email);
                MessageBox.Show("Welcome to Rooms 404. Enjoy!");

                AdminFormularService adminFormularService = new AdminFormularService();

                student = adminFormularService.GetStudent(utilizator.id);

                if (newUser.Role.ToString().Equals("Membru"))
                {
                    StudentModule mainWindow = new StudentModule(utilizator, student);
                    mainWindow.Show();
                    this.Close();
                }
                else if (newUser.Role.ToString().Equals("Administrator"))
                {
                    AdminModule adminModule = new AdminModule(utilizator);
                    adminModule.Show();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                EnterUsername.Clear();
                EnterPassword.Clear();
                EnterName.Clear();
                EnterSurname.Clear();
                EnterEmail.Clear();

                MessageBox.Show(ex.Message);
            }
        }
Exemple #9
0
 public MainWindow(utilizator utilizator)
 {
     InitializeComponent();
     this.utilizator  = utilizator;
     this.DataContext = this;
 }
Exemple #10
0
 public Login()
 {
     InitializeComponent();
     Utilizator = new utilizator();
 }
Exemple #11
0
 public Register_Admin()
 {
     InitializeComponent();
     utilizator = new utilizator();
     // SqlConnection con = new SqlConnection("Data Source=ZEROLEGION\\SQLEXPRESS;Initial Catalog=Rooms404Last; integrated security=SSPI");
 }
Exemple #12
0
 public DateStudent(utilizator Utilizator)
 {
     InitializeComponent();
     this.Utilizator  = Utilizator;
     this.DataContext = this;
 }