コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                UpFile u = new UpFile();
                u.SetFileNumber(comboBox2.Text);
                u.SetFileTitle(textBox3.Text);
                u.SetFileContent(textBox2.Text);
                u.SetFileStatus("0");

                if (u.UpfdateFileInfo(u))
                {
                    MessageBox.Show("更新公文編號:" + comboBox2.Text + "成功");
                    textBox1.Text = "";
                    textBox2.Text = "";
                    textBox3.Text = "";
                }
                else
                {
                    MessageBox.Show("更新公文編號:" + comboBox2.Text + " 失敗");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            UpFile u2 = new UpFile();

            u2             = u2.Retrieveq(comboBox2.Text);
            textBox1.Text  = u2.GetFileContent();
            label1.Text    = "公文標題:" + u2.GetFileTitle();
            label6.Text    = "需修改內容:" + u2.GetFFixContent();
            comboBox1.Text = "";
            comboBox2.Text = "";
        }