예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         CustomerMethods cm = new CustomerMethods();
         GridView1.DataSource = cm.ViewCustomer();
         GridView1.DataBind();
     }
 }
예제 #2
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("del"))
     {
         int             cid = Convert.ToInt32(e.CommandArgument);
         CustomerMethods Op  = new CustomerMethods();
         int             res = Op.Delete(cid);
         if (res > 0)
         {
             GridView1.DataSource = Op.ViewCustomer();
             GridView1.DataBind();
             Response.Write("Deactivated");
         }
     }
 }