public MainForm()
        {
            try
            {
                cs = new ConnectSQL();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            ws = new WebSocket();
            Form Login = new LoginForm(cs);

            Login.ShowDialog();

            InitializeComponent();
            this.Text = "Profile - ID" + cs.StudentID;

            labelName.Text  = cs.First + " " + cs.Last;
            labelEmail.Text = cs.Email;
            labelDPO.Text   = cs.DPO.ToString();
            labelTPO.Text   = cs.TPO.ToString();

            comboBoxNature.Items.AddRange(new string[] { "Cleaning", "Groceries", "Trash", "Noise", "Work Division", "Maintenance", "Other" });
            textBoxLocalPort.Text  = "1523";
            textBoxRemoteIP.Text   = ws.GetLocalIP();
            textBoxRemotePort.Text = "80";
            textBoxLocalIP.Text    = ws.GetLocalIP();
        }
        public Rules(ConnectSQL conssql)
        {
            InitializeComponent();
            cs = conssql;

            listView.Items.Clear();

            SqlConnection cnn = new SqlConnection(cs.ConStr);

            cnn.Open();

            SqlDataReader dataReader;
            SqlCommand    cmd = cnn.CreateCommand();

            string sql = "SElECT RuleID, RuleDescription FROM RuleTable";

            cmd        = new SqlCommand(sql, cnn);
            dataReader = cmd.ExecuteReader();

            while (dataReader.Read())
            {
                ListViewItem line = new ListViewItem(dataReader.GetValue(0).ToString());

                line.SubItems.Add(dataReader.GetValue(1).ToString());
                listView.Items.Add(line);
            }
            cnn.Close();
            dataReader.Close();
            cmd.Dispose();
        }
        public UpdateInfoForm(ConnectSQL consql, string i, string f, string l, string e, string c)
        {
            InitializeComponent();

            cs = consql;
            ID = i;

            textBoxC.Text = c;
            labelID.Text  = i;
            textBoxF.Text = f;
            textBoxL.Text = l;
            textBoxE.Text = e;
        }
示例#4
0
 public LoginForm(ConnectSQL consql)
 {
     InitializeComponent();
     cs = consql;
 }