Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("是否確定歸檔此公文?", "歸檔確認",
                                                  MessageBoxButtons.YesNo,
                                                  MessageBoxIcon.Question);
            UpFile set = new UpFile();

            set.SetFFixContent("無");
            set.SetFileStatus("3");
            set.SetFileNumber(comboBox1.Text); if (result == DialogResult.Yes)
            {
                try
                {
                    if (set.UpfdateUpFile(set))
                    {
                        MessageBox.Show("已成功歸檔公文:" + set.GetFileNumber() + "\n" + "歸檔時間:" + Convert.ToString(DateTime.Now), "送出結果"
                                        );


                        textBox2.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("退件公文:" + set.GetFileNumber() + "失敗");
                    }
                    this.Close();
                }


                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Esempio n. 2
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 = "";
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            UpFile u = new UpFile();

            u.DeleteFile(comboBox1.Text);
            MessageBox.Show("刪除 " + comboBox1.Text + "成功");
            textBox1.Text  = "";
            comboBox1.Text = "";
            u.SetFileStatus("3");
            comboBox1.DataSource = u.retrieveAllFile();
        }
Esempio n. 4
0
        public Sign1()
        {
            InitializeComponent();
            textBox2.AutoSize = false;
            textBox2.Height   = 100;
            textBox2.ReadOnly = true;
            UpFile objsh = new UpFile();

            objsh.SetFileStatus("0");
            comboBox1.DataSource = objsh.retrieveAllFile();
            System.ComponentModel.ComponentResourceManager resources = new
                                                                       System.ComponentModel.ComponentResourceManager(typeof(Login));
            this.skinEngine = new
                              Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
        }
Esempio n. 5
0
        public Clear()
        {
            InitializeComponent();
            textBox1.AutoSize = false;
            textBox1.Height   = 150;
            textBox1.ReadOnly = true;
            UpFile u = new UpFile();

            u.SetFileStatus("3");
            comboBox1.DataSource = u.retrieveAllFile();
            System.ComponentModel.ComponentResourceManager resources = new
                                                                       System.ComponentModel.ComponentResourceManager(typeof(Login));
            this.skinEngine = new
                              Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
        }
Esempio n. 6
0
        public UpFile Retrieveq(string num)
        {
            DBConnect dbconn = new DBConnect();

            dbconn.ConnectDB();
            UpFile objq = new UpFile();

            try
            {
                dbconn.getCmd().CommandText = "SELECT * from FileData WHERE FileNumber = '" + num + "'";
                dbconn.getCmd().CommandType = System.Data.CommandType.Text;
                dbconn.getConn().Open();

                OleDbDataReader reader = dbconn.getCmd().ExecuteReader();
                while (reader.Read())
                {
                    objq.SetFileNumber(reader["FileNumber"].ToString());
                    objq.SetFileTitle(reader["Title"].ToString());
                    objq.SetFileContent(reader["Content"].ToString());
                    objq.SetFileStatus(reader["Status"].ToString());
                    objq.SetFFixContent(reader["FixContent"].ToString());
                    objq.SetUpD(reader["FileDate"].ToString());
                    objq.SetUpT(reader["UpTime"].ToString());
                }
            }

            catch (Exception e)
            {
                System.Console.WriteLine("Error message :" + e.ToString());
            }
            finally
            {
                if (dbconn.getConn() != null)
                {
                    dbconn.getConn().Close();
                }
            }
            return(objq);
        }
Esempio n. 7
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex.Equals(0))
            {
                UpFile u = new UpFile();
                u.SetFileStatus("0");
                comboBox2.DataSource = u.retrieveAllFile();
                u             = u.Retrieveq(comboBox2.Text);
                textBox1.Text = u.GetFileContent();
            }


            else
            {
                UpFile u = new UpFile();
                u.SetFileStatus("1");
                comboBox2.DataSource = u.retrieveAllFile();

                u             = u.Retrieveq(comboBox2.Text);
                textBox1.Text = u.GetFileContent();
            }
        }