Ejemplo n.º 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (txtDeaCustID.Text == "")
            {
                MessageBox.Show("Please select a record to delete");
            }
            else
            {
                //Get the id of the user to be deleted from form
                dc.id = int.Parse(txtDeaCustID.Text);

                //Create boolean variable to check wheteher the dealer or customer is deleted or not
                bool success = dcDal.Delete(dc);

                if (success == true)
                {
                    //Dealer or Customer Deleted Successfully
                    MessageBox.Show("Dealer or Customer Deleted Successfully");
                    Clear();
                    //Refresh the Data Grid View
                    DataTable dt = dcDal.Select();
                    dgvDeaCust.DataSource = dt;
                }
                else
                {
                    //Dealer or Customer Failed to Delete
                    MessageBox.Show("Failed to Delete Dealer or Customer");
                }
            }
        }
Ejemplo n.º 2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            // Get the ID of the Product to be deleted

            dc.id = int.Parse(txtDeaCustID.Text);

            // Create a bool variable to check if the data is deleted

            bool success = dcDal.Delete(dc);

            // if product is deleted successfully then the value of success will be true else it will be flase

            if (success == true)
            {
                //Product Deleted successfully
                MessageBox.Show("Product Deleted Successfully");

                // we need to clear Text Boxes. we will write a method for this.
                // Calling the Clear Method
                Clear();

                // Refresh the Data Grid View as well.For that we wil lcreate a data Table.
                DataTable dt = dcDal.Select();

                dgvDeaCust.DataSource = dt;
            }
            else
            {
                MessageBox.Show("Product Not Deleted Successfully");
            }
        }
Ejemplo n.º 3
0
        } // This method is created to Update the Data in the DataGrid View or We can say Table

        private void btnDelete_Click(object sender, EventArgs e)
        {
            //ID of the User to be Deleted
            dc.id = int.Parse(txtDeaCustID.Text);


            //Create boolean variable to check whether the dealer or customer is deleted ro not
            bool success = dcDal.Delete(dc);

            if (success == true)
            {
                //Dealer or Customer Deleted Successfully
                MessageBox.Show("Dealer or Customer Deleted Sucessfully");


                //To Clear the Text Fields
                Clear();

                //Refresh the Table
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                //Failed to Delete Dealer or Customer
                MessageBox.Show("Failed to Delete Dealer or Customer");
            }
        } //This method is to Delete the Data in the Table
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                //get the id of the user to delete from data
                dc.id = int.Parse(txtDeaCustID.Text);

                //create boolean variable to check if the dealer/user deleted successfully or not
                bool success = dcDal.Delete(dc);

                if (success == true)
                {
                    //dealer or customer adding successfull
                    MessageBox.Show("Dealer/Customer deleting is Successfull!");
                    Clear();
                    //refresh datagrid view
                    DataTable dt = dcDal.Select();
                    dgvDeaCust.DataSource = dt;
                }
                else
                {
                    //dealer or customer adding failed
                    MessageBox.Show("Dealer/Customer deleting is Failed!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 5
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            dc.id = int.Parse(txtDeaCustID.Text);

            bool success = dcDal.Delete(dc);

            if (success)
            {
                Clear();
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                MessageBox.Show("Failed to delete dealer/customer");
            }
        }
Ejemplo n.º 6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            dc.id = int.Parse(txtDeaCustID.Text);
            bool success = dcDal.Delete(dc);

            if (success == true)
            {
                MessageBox.Show("Delaer or Customer Deleted Successfully");
                Clear();
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                MessageBox.Show("Failed to Delete Delaer or Customer");
            }
        }
Ejemplo n.º 7
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            dc.id = int.Parse(txtDeaCustID.Text);
            bool success = dcDal.Delete(dc);

            if (success == true)
            {
                MessageBox.Show("ทำการลบ Dealer หรือ Customer เรียบร้อยแล้ว");
                Clear();
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                MessageBox.Show("ไม่สามารถลบ Dealer หรือ Customer ได้! กรุณาลองอีกครั้ง");
            }
        }
Ejemplo n.º 8
0
        private void btnDeleteCust_Click(object sender, EventArgs e)
        {
            dc.id = int.Parse(txtCustID.Text);
            bool success = dcDal.Delete(dc);

            if (success == true)
            {
                Mymessage mymessage = new Mymessage("Data Deleted Successfully!");
                mymessage.Show();
                Clear();
                DataTable dt = dcDal.Select();
                GDVCustomer.DataSource = dt;
            }
            else
            {
                Mymessage mymessage = new Mymessage("Error While Deleting Data!");
                mymessage.Show();
            }
        }
Ejemplo n.º 9
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //get the id of the category from which we want to delete
            dc.id = int.Parse(txtDeaCustID.Text);
            bool success = dcdal.Delete(dc);

            if (success == true)
            {
                MessageBox.Show("Dealer or Customer Deleted Successfully");
                Clear();
                //refresh data grid view
                DataTable dt = dcdal.Select();
                dgvDeaCust.DataSource = dt;
            }

            else
            {
                MessageBox.Show("Failed to Delete Dealer or Customer");
            }
        }
Ejemplo n.º 10
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            dc.Id = int.Parse(txtDlr_CustID.Text);
            bool succes = dcdal.Delete(dc);

            if (succes == true)
            {
                MassageBox mb = new MassageBox("Deleted", MsgType.delete);
                mb.Show();
                //MessageBox.Show("Dealer/Customer Deleted Succesfully");
                Clear();
                DataTable dt = dcdal.Select();
                dgvDlr_Customer.DataSource = dt;
            }
            else
            {
                MassageBox mb = new MassageBox("Delete Failed", MsgType.retry);
                mb.Show();
                //MessageBox.Show("Failed to Delete Dealer/Customer...!!! Try Again");
            }
        }
Ejemplo n.º 11
0
        private void BtnDELETE_Click(object sender, EventArgs e)
        {
            d.id = Convert.ToInt32(txtDeaCustID.Text);
            bool success = dal.Delete(d);

            //if data is deleted then value of success will be true else it will be false
            if (success == true)
            {
                //User Deleted Successfully
                MessageBox.Show("Data deleted successfully");
                Clear();
            }
            else
            {
                //Failed to Delete User
                MessageBox.Show("Dailed Data to deleted");
            }
            //Refreshing Data Grid View
            DataTable dt = dal.Select();

            dgvDeaCust.DataSource = dt;
        }
Ejemplo n.º 12
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            // get the id of the user to be deleted
            dc.id = int.Parse(txtDeaCustID.Text);

            // boolean var to check if the data dealer/customer is deleted or not
            bool success = dcDal.Delete(dc);

            if (success == true)
            {
                // dealer/cutomer is deleted successfully
                MessageBox.Show("Dealer or Customer deleted Successfully");
                Clear();
                // refresh the data grid view
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                MessageBox.Show("Failed to delete Dealer/Customer");
            }
        }
Ejemplo n.º 13
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //Get to ID of the category which we want to delete
            dc.id = int.Parse(txtDeaCustID.Text);

            //Creating Boolean variable to Delete The category
            bool success = dcDal.Delete(dc);

            //If the category id Deleted Successfully then the value of success will be true else it will be false
            if (success == true)
            {
                //category Deleted Successfully
                MessageBox.Show(" Deleted Successful.");
                Clear();
                //Refreshing Data grid view
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                //category deleted failed
                MessageBox.Show("Failed to Delete.");
            }
        }
Ejemplo n.º 14
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //Get the ID of the user to be Deleted from form
            dc.id = int.Parse(txtDeaCustID.Text);

            //Boolean Variable to check the dealer or Customer is Deleted or not
            bool success = dcDal.Delete(dc);

            if (success == true)
            {
                MessageBox.Show("Dealer or Customer Deleted Successfully.");
                Clear();

                //Refresh Data Grid View
                DataTable dt = dcDal.Select();
                dgvDeaCust.DataSource = dt;
            }
            else
            {
                MessageBox.Show("Failed to Delete Dealer or Customer.");
            }

            error();
        }
Ejemplo n.º 15
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            #region Throw Error Message

            if (txtDeaCustID.Text == "" && cmbDeaCust.Text == "" && txtName.Text == "" && txtEmail.Text == "" && txtContact.Text == "" && txtAddress.Text == "")
            {
                MessageBox.Show(" Please Select First Into DataGrid View Then Delete Data.... !! ");
            }

            #endregion

            else
            {
                //Get the ID of the user to be Deleted from form
                dc.id = int.Parse(txtDeaCustID.Text);

                //Boolean Variable to check the dealer or Customer is Deleted or not
                bool success = dcDal.Delete(dc);

                if (success == true)
                {
                    MessageBox.Show("Dealer or Customer Deleted Successfully.");
                    Clear();

                    //Refresh Data Grid View
                    DataTable dt = dcDal.Select();
                    dgvDeaCust.DataSource = dt;
                }

                else
                {
                    MessageBox.Show("Failed to Delete Dealer or Customer.");
                }
                error();
            }
        }