예제 #1
0
        private void button3_Click(object sender, EventArgs e)   //수입 저장
        {
            DBHandling currentDB = new DBHandling(filepath);

            if (Sum.Text == String.Empty)
            {
                MessageBox.Show("금액을 입력해야합니다.", "오류");
            }
            else
            {
                if (Name1.Text == String.Empty)
                {
                    if (comboBox1.Text != "" && comboBox2.Text != "" && comboBox3.Text != "")
                    {
                        currentDB.add(incom_rowcount, today_date, "무명", Name2.Text, Int64.Parse(Sum.Text.Replace(",", "")), Note.Text, igcode, ihcode, imcode);
                        Name2.Text = "";
                        Sum.Text   = "";
                        Note.Text  = "";
                    }
                    else
                    {
                        MessageBox.Show("관, 항, 목을 선택해야합니다.", "오류");
                    }
                }
                else
                {
                    if (comboBox1.Text != "" && comboBox2.Text != "" && comboBox3.Text != "")
                    {
                        currentDB.add(incom_rowcount, today_date, Name1.Text, Name2.Text, Int64.Parse(Sum.Text.Replace(",", "")), Note.Text, igcode, ihcode, imcode);
                        Name1.Text = "";
                        Name2.Text = "";
                        Sum.Text   = "";
                        Note.Text  = "";
                    }
                    else
                    {
                        MessageBox.Show("관, 항, 목을 선택해야합니다.", "오류");
                    }
                }
                load_data();
            }
        }