예제 #1
0
        private void listView2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView2.SelectedItems.Count != 1)
            {
                return;
            }
            int     num = Convert.ToInt32(listView2.SelectedItems[0].SubItems[3].Text);
            reading rd  = new reading(3, num);

            rd.ShowDialog();
        }
예제 #2
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            string        title  = listView1.SelectedItems[0].SubItems[2].Text;
            string        sql    = "select [id] from [dbo].[ReadingArticle] where title='" + title + "'";
            SqlDataReader reader = DatabaseHelp.getReader(sql);

            reader.Read();
            int x = DatabaseHelp.convert(1, reader["id"]);

            reader.Close();
            reading rd = new reading(1, x);

            rd.ShowDialog();
        }
예제 #3
0
        private void reading_Click(object sender, EventArgs e)
        {
            int artnumber = Convert.ToInt32((sender as Button).Name.Replace("button", ""));

            string name = "reading" + artnumber.ToString();
            string sql  = "select " + name + " from [dbo].[TestSet] where id=" + this.tpoNo.ToString();

            SqlDataReader reader = DatabaseHelp.getReader(sql);

            reader.Read();
            int x = DatabaseHelp.convert(1, reader[name]);

            reader.Close();

            reading read_form = new reading(1, x);

            read_form.ShowDialog();
        }
예제 #4
0
        private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.listBox1.IndexFromPoint(e.Location);

            if (index == System.Windows.Forms.ListBox.NoMatches)
            {
                return;
            }
            if (SystemConfig.name == "admin")
            {
                string[] item;
                item = listBox1.Items[index].ToString().Split(':');
                string name  = item[0];
                string title = "";
                for (int i = 1; i < item.Length; i++)
                {
                    title += item[i];
                }
                string        sql    = "select * from UserSuggestion where name = '" + name + "' and title = '" + title + "'";
                SqlDataReader reader = DatabaseHelp.getReader(sql);
                while (reader.Read())
                {
                    feedbackAdmin fd     = new feedbackAdmin(reader["title"].ToString(), reader["name"].ToString(), reader["suggest"].ToString(), reader["date"].ToString());
                    DialogResult  result = fd.ShowDialog();
                    if (result == DialogResult.No)
                    {
                        reader.Close();
                        return;
                    }
                }
                reader.Close();
                sql = "delete from UserSuggestion where name = '" + name + "' and title = '" + title + "'";
                DatabaseHelp.executeCommand(sql);
                setup();
            }
            else
            {
                //链接到reading界面
                reading rd = new reading(3, errid[index]);
                rd.ShowDialog();
            }
        }
예제 #5
0
        public ansList(reading rd)
        {
            InitializeComponent();
            this.rrd = rd;
            double totalColumnWidth = 8.0;  //1.0+2.0+1.0 = 4.0

            //设置第一列所占百分比
            double colPercentage0 = 1 / totalColumnWidth;

            listView1.Columns[0].Width = (int)(colPercentage0 * listView1.ClientRectangle.Width);

            //设置第二列所占百分比
            double colPercentage1 = 5 / totalColumnWidth;

            listView1.Columns[1].Width = (int)(colPercentage1 * listView1.ClientRectangle.Width);

            //设置第三列所占百分比
            double colPercentage2 = 1 / totalColumnWidth;

            listView1.Columns[2].Width = (int)(colPercentage2 * listView1.ClientRectangle.Width);
        }
예제 #6
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            reading rd = new reading(2, this.tpoNo);

            rd.ShowDialog();
        }
예제 #7
0
파일: score.cs 프로젝트: zhangfuyang/toefl
 public score(reading rrd)
 {
     InitializeComponent();
     this.rd = rrd;
 }