예제 #1
0
    protected void Button111_Click(object sender, EventArgs e)
    {
        GridViewJobsApps2.Visible = true;
        string        connStr = ConfigurationManager.ConnectionStrings["MyDbConn"].ToString();
        SqlConnection conn    = new SqlConnection(connStr);

        conn.Open();
        SqlCommand cmd = new SqlCommand("QapplyJ", conn);

        cmd.CommandType = CommandType.StoredProcedure;
        //string userId = Session["Username"].ToString();
        cmd.Parameters.Add(new SqlParameter("@username", Session["Username"].ToString()));
        cmd.Parameters.Add(new SqlParameter("@company", TextBox11.Text.ToString()));
        cmd.Parameters.Add(new SqlParameter("@Job_title", TextBox33.Text.ToString()));
        cmd.Parameters.Add(new SqlParameter("@departement", Convert.ToInt32(TextBox22.Text)));
        GridViewJobsApps2.EmptyDataText = "No Records Found";
        SqlDataAdapter adapter = new SqlDataAdapter(cmd);
        DataSet        ds      = new DataSet();

        adapter.Fill(ds);
        if (ds.Tables.Count == 0)
        {
            GridViewJobsApps2.Visible = false;
            Response.Write("no records");
        }
        else
        {
            GridViewJobsApps2.DataSource = ds;
            GridViewJobsApps2.DataBind();
            GridViewJobsApps2.Visible = true;
            btnProcess.Visible        = true;
            Button1a.Visible          = true;
        }
        conn.Close();
    }
예제 #2
0
    protected void Button5_Click(object sender, EventArgs e)
    {
        Label1.Visible            = false;
        Label2.Visible            = false;
        TextBox1.Visible          = false;
        Label3.Visible            = false;
        Button3.Visible           = false;
        DropDownList1.Visible     = true;
        Button5.Visible           = true;
        Label4.Visible            = true;
        GridViewJobsApps2.Visible = true;
        job_info.Visible          = true;
        job_seekers.Visible       = true;

        string        connStr = ConfigurationManager.ConnectionStrings["MyDbConn"].ToString();
        SqlConnection conn    = new SqlConnection(connStr);

        conn.Open();
        SqlCommand cmd = new SqlCommand("ViewApps", conn);

        cmd.CommandType = CommandType.StoredProcedure;
        string userId = Session["Username"].ToString();

        cmd.Parameters.Add(new SqlParameter("@manager", userId));
        cmd.Parameters.Add(new SqlParameter("@Job_title", Session["SelectedJob"].ToString()));
        GridViewJobsApps.EmptyDataText  = "No Records Found";
        GridViewJobsApps2.EmptyDataText = "No Records Found";
        SqlDataAdapter adapter = new SqlDataAdapter(cmd);
        DataSet        ds      = new DataSet();

        adapter.Fill(ds);
        //GridViewJobsApps.DataSource = ds.Tables[0].DefaultView;

        if (ds.Tables.Count == 0)
        {
            GridViewJobsApps.Visible  = false;
            GridViewJobsApps2.Visible = false;
            job_info.Visible          = false;
            job_seekers.Visible       = false;
            Response.Write("no records");
        }
        else
        {
            GridViewJobsApps.DataSource = ds;
            GridViewJobsApps.DataBind();
            GridViewJobsApps.Visible     = true;
            GridViewJobsApps2.DataSource = ds.Tables[1];
            GridViewJobsApps2.DataBind();
            GridViewJobsApps2.Visible = true;
        }

        conn.Close();
    }