Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool ifConnected = OracleHelper.CheckOracleConnect(ReadPropertyFile.getOraConnStr());

            if (ifConnected)
            {
                MessageBox.Show("ok");
            }
            else
            {
                MessageBox.Show("no");
            }
        }
Exemple #2
0
 private void exeUpdate(string fieldNm, string fieldValue, string taskNm)
 {
     OracleParameter[] param = new OracleParameter[] {
         new OracleParameter(":" + fieldNm, OracleDbType.Varchar2),
         new OracleParameter(":TASKNM", OracleDbType.Varchar2),
     };
     param[0].Value = fieldValue;
     param[1].Value = taskNm;
     upCnt          = OracleHelper.ExecuteNonQuery(ReadPropertyFile.getOraConnStr(), CommandType.Text, OracleSQL.upOneField(fieldNm), param);
     if (upCnt > 0)
     {
         this.loadAll(ReadPropertyFile.getOraConnStr(), OracleSQL.getAll);
     }
 }
Exemple #3
0
        private void button1_save_Click(object sender, EventArgs e)
        {
            int i = 0;

            if (!saveCheck(textBox1_taskNm.Text, dateTimePicker1_preStartTime.Value, dateTimePicker1_preEndTime.Value, textBox1_taskOwner.Text))
            {
                return;
            }

            OracleParameter[] param = new OracleParameter[] {
                new OracleParameter(":taskOwner", OracleDbType.Varchar2),
                new OracleParameter(":preStartTime", OracleDbType.Varchar2),
                new OracleParameter(":preEndTime", OracleDbType.Varchar2),
                new OracleParameter(":bikou", OracleDbType.Varchar2),
                new OracleParameter(":taskNm", OracleDbType.Varchar2),
            };
            param[0].Value = textBox1_taskOwner.Text;
            param[1].Value = dateTimePicker1_preStartTime.Value.ToString("yyyy/MM/dd");
            param[2].Value = dateTimePicker1_preEndTime.Value.ToString("yyyy/MM/dd");
            param[3].Value = richTextBox1.Text;
            param[4].Value = textBox1_taskNm.Text;

            if (fpUpdateFlg == 1)
            {
                // 插入数据库表
                i = OracleHelper.ExecuteNonQuery(ReadPropertyFile.getOraConnStr(), CommandType.Text, OracleSQL.InsertTask, param);
            }
            else
            {
                i = OracleHelper.ExecuteNonQuery(ReadPropertyFile.getOraConnStr(), CommandType.Text, OracleSQL.UpdateTask, param);
            }
            if (i == 1)
            {
                MessageBox.Show("保存成功");
                Form1 f1;
                f1 = (Form1)this.Owner;
                f1.loadAll(ReadPropertyFile.getOraConnStr(), OracleSQL.getAll);
                this.Close();
            }
            else
            {
                MessageBox.Show("保存失敗");
            }
        }
Exemple #4
0
        private void exeUpdate(string zkEndTime, string zkEndTm_val, string zkKousu, string zkKousu_val, string taskNm)
        {
            OracleParameter[] param = new OracleParameter[] {
                new OracleParameter(":" + zkEndTime, OracleDbType.Varchar2),
                new OracleParameter(":" + zkKousu, OracleDbType.Varchar2),
                new OracleParameter(":TASKNM", OracleDbType.Varchar2),
            };
            param[0].Value = zkEndTm_val;
            param[1].Value = zkKousu_val;
            param[2].Value = taskNm;
            List <string> taskList = new List <string>();

            taskList.Add(zkEndTime);
            taskList.Add(zkKousu);
            upCnt = OracleHelper.ExecuteNonQuery(ReadPropertyFile.getOraConnStr(), CommandType.Text, OracleSQL.updateTask(taskList), param);
            if (upCnt > 0)
            {
                this.loadAll(ReadPropertyFile.getOraConnStr(), OracleSQL.getAll);
            }
        }
Exemple #5
0
        private void button_taskDel_Click(object sender, EventArgs e)
        {
            int selectedCnt = dataGridView1.SelectedRows.Count;

            if (selectedCnt == 0)
            {
                MessageBox.Show("削除したい行を選択してください");
                return;
            }

            DialogResult dr = MessageBox.Show(selectedCnt.ToString() + "件タスクを削除してよろしいですか?", "メッセージ", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (dr == DialogResult.Cancel)

            {
                return;
            }

            else

            {
                OracleParameter[] param = new OracleParameter[] {
                    new OracleParameter(":taskNm", OracleDbType.Varchar2),
                };
                param[0].Value = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                int delCnt = OracleHelper.ExecuteNonQuery(ReadPropertyFile.getOraConnStr(), CommandType.Text, OracleSQL.DeleteTask, param);
                if (delCnt > 0)
                {
                    MessageBox.Show(delCnt.ToString() + "件タスクが削除されました");
                    this.loadAll(ReadPropertyFile.getOraConnStr(), OracleSQL.getAll);
                }
                else
                {
                    MessageBox.Show("タスクが削除が失敗しました");
                }
            }
        }
Exemple #6
0
 private void Form1_Load(object sender, EventArgs e)
 {
     this.loadAll(ReadPropertyFile.getOraConnStr(), OracleSQL.getAll);
 }