コード例 #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            addMember addMemberOBj = new addMember();

            addMemberOBj.mID       = int.Parse(mIDTextBox.Text);
            addMemberOBj.name      = nameTextBox.Text;
            addMemberOBj.contactNo = contactNoTextBox.Text;
            addMemberOBj.email     = emailTextBox.Text;
            addMemberOBj.address   = addressTextBox.Text;

            addMemberBL addMemberBLOBj = new addMemberBL();
            bool        result         = addMemberBLOBj.ValidateNewMemberAndSendToDA(addMemberOBj);


            if (result)
            {
                MessageBox.Show("Succesful Added!!!!");
                CleanTextBar();
                this.PopulateGridView();
                //tSSLabel1.Text = "Succesfull!!";
                // label1.Text = rowsAffected + " Rows Succesfull!!!!!!!!!!";
            }

            else
            {
                MessageBox.Show("ERROR!!", "Alert!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            addMember addMemberOBj = new addMember();

            addMemberOBj.mID       = int.Parse(mIDTextBox.Text);
            addMemberOBj.name      = nameTextBox.Text;
            addMemberOBj.contactNo = contactNoTextBox.Text;
            addMemberOBj.email     = emailTextBox.Text;
            addMemberOBj.address   = addressTextBox.Text;

            addMemberBL addMemberBLOBj = new addMemberBL();
            bool        result         = addMemberBLOBj.DeleteMemberFromBL(addMemberOBj);


            if (result)
            {
                MessageBox.Show("Succesfully Delete!!!!");
                CleanTextBar();
                this.PopulateGridView();
            }

            else
            {
                MessageBox.Show("ERROR!!", "Alert!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void PopulateGridView()
        {
            DataTable   dt             = new DataTable();
            addMemberBL addMemberBLOBj = new addMemberBL();

            dt = addMemberBLOBj.GetExistingdMemberBL();
            memberDataGridView.DataSource = dt;
        }