示例#1
0
        public static void Delete_details(HashSet <int> detail_hs)
        {
            if (detail_hs == null || detail_hs.Count < 1)
            {
                return;
            }

            DB_delete del = new DB_delete();

            del.tableName = DividendDetail_master.Detail_tableName;

            SQL_relation rela = new SQL_relation("DetailID", true, detail_hs);

            del.SetCondition(rela);

            int count = del.SaveToDB(Utility.Get_DRWIN_hDB());

            if (count > 0)
            {
                MessageBox.Show("Detail Deleted! (" + count + ")");
            }
            else
            {
                MessageBox.Show("Nothing deleted?!");
            }
        }
示例#2
0
        public void Delete_DTC_position()
        {
            if (this.DividendIndex < 0)
            {
                return;
            }

            DB_delete del = new DB_delete();

            del.tableName = "Dividend_DTC_Position";
            SQL_relation rela = new SQL_relation("DividendIndex", RelationalOperator.Equals, this.DividendIndex);

            del.SetCondition(rela);

            int count = del.SaveToDB(Utility.Get_DRWIN_hDB());
        }
示例#3
0
        private void delDvd_button_Click(object sender, EventArgs e)
        {
            int dvdIndex = (int)this.dvdIndex_numericUpDown.Value;

            if (MessageBox.Show("Delete Dividend " + dvdIndex + "?", "Warning!", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                SQL_relation rela = new SQL_relation("DividendIndex", RelationalOperator.Equals, dvdIndex);

                string[] tablesDeleteFrom =
                { "Dividend_DTC_Position",
                  "Dividend_filing",
                  "Dividend_Payment",
                  "Dividend_Rejection",
                  "Dividend_Schedule_Of_Fees_DSC",
                  "Dividend_Control" };

                int total = 0;
                foreach (string tableName in tablesDeleteFrom)
                {
                    DB_delete del = new DB_delete();
                    del.tableName = tableName;
                    del.SetCondition(rela);

                    int count = del.SaveToDB(Utility.Get_DRWIN_hDB());
                    if (count > 0)
                    {
                        total += count;
                    }
                }

                if (total > 0)
                {
                    MessageBox.Show("Dividend " + dvdIndex + " Deleted!");
                }
                else
                {
                    MessageBox.Show("Nothing?! (" + dvdIndex + ")");
                }
            }
        }
示例#4
0
        private void del_dvdDetail_button_Click(object sender, EventArgs e)
        {
            int detailID = (int)this.del_dvdDetail_numericUpDown.Value;

            if (MessageBox.Show("Delete Detail " + detailID + "?", "Warning!", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                SQL_relation rela = new SQL_relation("DetailID", RelationalOperator.Equals, detailID);

                DB_delete del0 = new DB_delete();
                del0.tableName = "Dividend_Detail";
                del0.SetCondition(rela);

                int count0 = del0.SaveToDB(Utility.Get_DRWIN_hDB());

                if (count0 > 0)
                {
                    MessageBox.Show("Detail " + detailID + " Deleted!");
                }
                else
                {
                    MessageBox.Show("Nothing?! (" + detailID + ")");
                }
            }
        }