예제 #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (dealerBiz == null)
     {
         dealerBiz = new DealerBiz();
     }
     if (dealerBiz.DeleteDealer(DealerID))
     {
         Response.Redirect("dealer.aspx");
     }
 }
예제 #2
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                dealerBiz = new DealerBiz();
                foreach (GridViewRow row in gvDealer.Rows)
                {
                    var cbDealer   = row.FindControl("cbDealer") as CheckBox;
                    var hfDealerId = row.FindControl("hfDealerId") as HiddenField;

                    bool isChecked = cbDealer.Checked;
                    if (isChecked)
                    {
                        dealerBiz.DeleteDealer(hfDealerId.Value);
                    }
                }

                BindGrid();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }