Exemplo n.º 1
0
        public void Register_Button_Click(object sender, RoutedEventArgs e)
        {
            if (Login.Text.Length == 0 || RegisterPassword.Text.Length == 0 || ConfirmPassword.Text.Length == 0)
            {
                MessageBox.Show("Заповніть всі поля");
                return;
            }
            else if (RegisterPassword.Text != ConfirmPassword.Text)
            {
                MessageBox.Show("Паролі не співпадають");
                return;
            }
            else
            {
                DB_ServerConnection cnn = DB_ServerConnection.getInstance();

                string[] res = cnn.Connect("select Student_Password from Student where Student_Login = '******'").Split('/');
                if (res[0].Length != 0)
                {
                    MessageBox.Show("Користувач з таким логіном вже існує");
                }
                else
                {
                    cnn.Connect("insert into Student (Student_Login, Student_Password) values('" + Login.Text + "', '" + RegisterPassword.Text + "')");
                    ProfileSearchWindow p = new ProfileSearchWindow(Login.Text);
                    p.Show();
                    this.Close();
                }
            }
        }
Exemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.SearchWindow = ((NAZAR_LAB.ProfileSearchWindow)(target));
                return;

            case 2:

            #line 30 "..\..\ProfileSearchWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_Profile);

            #line default
            #line hidden
                return;

            case 3:

            #line 31 "..\..\ProfileSearchWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_Search);

            #line default
            #line hidden
                return;

            case 4:
                this.frame = ((System.Windows.Controls.Frame)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 3
0
        private void Save_Button_Click(object sender, RoutedEventArgs e)
        {
            DB_ServerConnection cnn = DB_ServerConnection.getInstance();

            cnn.Connect("update Student set Student_First_Name = '" + inpName.Text +
                        "', Student_Last_Name = '" + inpSurname.Text +
                        "', Age = '" + inpAge.Text +
                        "', Student_Group = '" + inpGroup.Text +
                        "', Institute = '" + inpInst.Text +
                        "', Specialty = '" + InpSpec.Text +
                        "', Student_Card_ID= '" + inpStudID.Text +
                        "' where Student_Login = '******'");
            MessageBox.Show("Зміни збережено");
        }
Exemplo n.º 4
0
        public Profile()
        {
            InitializeComponent();
            DB_ServerConnection cnn = DB_ServerConnection.getInstance();
            string str = cnn.Connect("select Student_First_Name, Student_Last_Name, Age, Student_Group, Institute, Specialty,  Student_Card_ID from Student where Student_Login = '******'");
            List <Student> User = DB_ServerConnection.MakeListFromString(str);

            inpName.Text    = User[0].FirstName;
            inpSurname.Text = User[0].LastName;
            inpStudID.Text  = User[0].Student_Card_ID;
            inpAge.Text     = User[0].Age;
            inpInst.Text    = User[0].Institute;
            InpSpec.Text    = User[0].Specialty;
            inpGroup.Text   = User[0].Group;
        }
Exemplo n.º 5
0
        private void Login_Button_Click(object sender, RoutedEventArgs e)
        {
            DB_ServerConnection cnn = DB_ServerConnection.getInstance();

            string[] res = cnn.Connect("select Student_Password from Student where Student_Login = '******'").Split('/');
            if (res[0].Length == 0)
            {
                MessageBox.Show("Користувача з таким логіном не існує");
            }
            else if (res[0] != Password.Password)
            {
                MessageBox.Show("Невірний пароль");
            }
            else if (res[0] == Password.Password)
            {
                ProfileSearchWindow p = new ProfileSearchWindow(Login.Text);
                this.Close();
                p.Show();
            }
        }