Exemplo n.º 1
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     ConnSQL connSQL = new ConnSQL();
     bool success = connSQL.authentication(UsernameTextbox.Text, passwordBox1.Password);
     if (success == true)
     {
         MessageBox.Show("Authentication succeded.", "Talk2Me", MessageBoxButton.OK, MessageBoxImage.Exclamation);
         TechnicalSupport ts = new TechnicalSupport();
         ts.UsernameTextBlock.Text = UsernameTextbox.Text;
         this.Hide();
         ts.Show();
     }
     else MessageBox.Show("Authentication failed.", "Talk2Me", MessageBoxButton.OK, MessageBoxImage.Stop);
 }
Exemplo n.º 2
0
        public TechnicalSupport()
        {
            InitializeComponent();

          //  dataGrid1.ItemsSource = new ObservableCollection<Object[]>();
           // dataGrid1.ItemsSource.
           
           
            user_list = new List<string>();
            ConnSQL connSQL = new ConnSQL();

            string users = connSQL.getUsers();
            listBox1.Items.Clear();
            string[] str = null;// user.GroupsFriends;
            string delimit = "|";
            Label newlabel;
            str = users.Split(delimit.ToCharArray());
            for (int i = 0; i < str.Length; i++)
            {

                newlabel = new Label();
                newlabel.HorizontalAlignment = HorizontalAlignment.Center;
                newlabel.FontSize = 14;
                newlabel.Content = str[i];
                newlabel.ContextMenu = new ContextMenu();
                MenuItem mi = new MenuItem();
                mi.Header = "Remove user";
                mi.Click += new RoutedEventHandler(MiRemoveUser_Click);
                newlabel.ContextMenu.Items.Add(mi);
                newlabel.Height = 40;
                newlabel.HorizontalAlignment = HorizontalAlignment.Center;
                newlabel.Width = 234;
                newlabel.MouseEnter += new MouseEventHandler(newlabel_MouseEnter);   
                listBox1.Items.Add(newlabel);
                user_list.Add(str[i]);

            }

        }
Exemplo n.º 3
0
        void MiRemoveUser_Click(object sender, RoutedEventArgs e)
        {
            
            ConnSQL connSQL = new ConnSQL();


            connSQL.deleteUser(this.selectedlabel.Content.ToString());
            user_list.Remove(this.selectedlabel.Content.ToString());
            updateContactListBox();

        }