Exemplo n.º 1
0
        private void SelectUser()
        {
            if (listView.SelectedItem == null)
            {
                MessageBox.Show("Спочатку треба обрати елемент у таблиці", "Увага"); return;
            }

            if (listView.SelectedItem is Users)
            {
                Users user = listView.SelectedItem as Users;
                int   id   = 0;
                using (DBWokrSql db = new DBWokrSql(Connection))
                    id = db.GetIdUser(user.Fname, user.Lname);
                WindowStatistic ws = new WindowStatistic(TypeForm.User, Connection, CurrentAdmin, id);
                ws.ShowDialog();
            }
            else
            if (listView.SelectedItem is Ticket)
            {
                Ticket ticket = listView.SelectedItem as Ticket;

                WindowTicket wt = new WindowTicket(Connection, ticket.ID);

                wt.ShowDialog();
            }
        }
Exemplo n.º 2
0
        private void SelectUser()
        {
            if (listView.SelectedItem == null) { MessageBox.Show("Спочатку треба обрати елемент у таблиці", "Увага"); return; }

            if (listView.SelectedItem is Users)
            {
                    Users user = listView.SelectedItem as Users;
                    int id = 0;
                    using (DBWokrSql db = new DBWokrSql(Connection))
                        id = db.GetIdUser(user.Fname, user.Lname);
                    WindowStatistic ws = new WindowStatistic(TypeForm.User, Connection, CurrentAdmin, id);
                    ws.ShowDialog();

            }
            else
                if(listView.SelectedItem is Ticket)
            {
                Ticket ticket = listView.SelectedItem as Ticket;

                WindowTicket wt = new WindowTicket(Connection, ticket.ID);

                wt.ShowDialog();
            }
        }