コード例 #1
0
        private void DeleteBtn_Click(object sender, EventArgs e)
        {
            if (givingDataGridView.Rows.Count == 0)
            {
                return;
            }
            int id = Convert.ToInt32(givingDataGridView.SelectedRows[0].Cells["givingId"].Value);

            GivingsController gc = new GivingsController();

            Giving giving = gc.Show(id);

            DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete Oferring of " + giving.member.firstName + "\n NOTE: this action cannot be undone!",
                                                        "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);

            if (dialogResult == DialogResult.No)
            {
                return;
            }
            else if (dialogResult == DialogResult.Yes)
            {
                giving.Delete();
                MessageBox.Show("Offering Type Deleted from records!", "Offering Type Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadGivings();
            }
        }
コード例 #2
0
        private void GivingDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            GivingsController gc = new GivingsController();
            Giving            g  = gc.Show((int)givingDataGridView.SelectedRows[0].Cells["givingId"].Value);

            if (g != null)
            {
                LoadGivingItems(g);
            }
        }
コード例 #3
0
        public GivingItem(DataRow r)
        {
            GivingsController     gc  = new GivingsController();
            GivingTypesController gtc = new GivingTypesController();

            this.id         = Convert.ToInt32(r["givingItemId"]);
            this.giving     = gc.Show(Convert.ToInt32(r["givingId"]));
            this.givingType = gtc.Show(Convert.ToInt32(r["givingTypeId"]));
            this.amount     = Convert.ToDouble(r["amount"]);
            this.note       = r["note"].ToString();
        }
コード例 #4
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            if (givingDataGridView.Rows.Count == 0)
            {
                return;
            }
            GivingsController gc     = new GivingsController();
            Giving            giving = gc.Show(Convert.ToInt32(givingDataGridView.SelectedRows[0].Cells["givingId"].Value));

            AddUpdateGivingFrm addGivingFrm = new AddUpdateGivingFrm(true, giving);

            addGivingFrm.FormClosing += new FormClosingEventHandler(this.GivingUpdated);
            addGivingFrm.ShowDialog();
        }
コード例 #5
0
        public override void Add(params Param[] @params)
        {
            if (@params.Length != 4)
            {
                return;
            }
            GivingsController     gc  = new GivingsController();
            GivingTypesController gtc = new GivingTypesController();

            if (gc.Show((int)@params[0].value) == null || gtc.Show((int)@params[1].value) == null)
            {
                MessageBox.Show("Offering or Offering Type not found!", "Offering Item Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            base.Add(@params);
        }