Exemplo n.º 1
0
        protected void Btn_Delete_Click(object sender, EventArgs e)
        {
            Button currentButton = (Button)sender;
            String id            = currentButton.ID.Substring(0, currentButton.ID.IndexOf('d'));
            int    selectedRowID = Int32.Parse(id);

            PaymentTypeController.delete(selectedRowID);
            Response.Redirect("ViewPaymentType.aspx");
        }
Exemplo n.º 2
0
        protected void Delete_Click(object sender, EventArgs e)
        {
            int    id           = Int32.Parse((sender as LinkButton).CommandArgument);
            string messageError = PaymentTypeController.delete(id);

            if (messageError != "")
            {
                lblErrorViewPaymentType.Text = messageError;
            }
            else
            {
                PaymentTypeHandler.remove(id);
                Load_PaymentType();
                Response.Redirect(Constant.Routes.VIEW_PAYMENT_TYPE);
                lblErrorViewPaymentType.Text = "Payment type has been deleted";
            }
        }