Exemplo n.º 1
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            if (listView1.CheckedItems.Count != 0)
            {
                string selectcommand = string.Format(@"Select * from Teachers_Data where Teacher='{0}'", listView1.CheckedItems[0].SubItems[0].Text.Trim());
                DataTable dt = help.getDs(selectcommand, "Teacher_Data").Tables[0];
                if (listView1.CheckedItems[0].SubItems[1].Text != "")
                {

                    string startweek = listView1.CheckedItems[0].SubItems[1].Text.Substring(0, listView1.CheckedItems[0].SubItems[1].Text.IndexOf(" "));
                    frmSupervisor sp = new frmSupervisor(dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString(), startweek);
                    sp.Show();
                }
                else
                {
                    string startweek = "1";
                    frmSupervisor sp = new frmSupervisor(dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString(), startweek);
                    sp.Show();
                }

                this.Close();
            }
            else
            {
                MessageBox.Show("请勾选相应的督导");

            }
        }
Exemplo n.º 2
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            if (listView1.CheckedItems.Count != 0)
            {
                string    selectcommand = string.Format(@"Select * from Teachers_Data where Teacher='{0}'", listView1.CheckedItems[0].SubItems[0].Text.Trim());
                DataTable dt            = help.getDs(selectcommand, "Teacher_Data").Tables[0];
                if (listView1.CheckedItems[0].SubItems[1].Text != "")
                {
                    string        startweek = listView1.CheckedItems[0].SubItems[1].Text.Substring(0, listView1.CheckedItems[0].SubItems[1].Text.IndexOf(" "));
                    frmSupervisor sp        = new frmSupervisor(dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString(), startweek);
                    sp.Show();
                }
                else
                {
                    string        startweek = "1";
                    frmSupervisor sp        = new frmSupervisor(dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString(), startweek);
                    sp.Show();
                }

                this.Close();
            }
            else
            {
                MessageBox.Show("请勾选相应的督导");
            }
        }