Example #1
0
    protected void view_users(int x)
    {
        user_infoBAL uBAL = new user_infoBAL();
        user_infoBO  uBO  = new user_infoBO();

        uBO.user_type = x;

        try
        {
            DataTable dt = uBAL.view_users(uBO);

            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
Example #2
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        user_infoBAL uBAL = new user_infoBAL();
        user_infoBO  uBO  = new user_infoBO();
        TableCell    cell = GridView1.Rows[e.RowIndex].Cells[1];
        string       abc  = cell.Text;

        uBO.user_id = Convert.ToInt32(abc);


        try
        {
            uBAL.delete_users(uBO);
            Response.Write("<script>alert('Data deleted successfully " + abc + "');</script>");

            view_users(0);
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }