private void PopulateGridViewDisplayJobDetails(int companyId) { var jobBal = new JobBAL(); var table = jobBal.GetJobDetails(companyId); GridViewDisplayJobDetails.DataSource = table; GridViewDisplayJobDetails.DataBind(); }
protected void ButtonSearch_Click(object sender, EventArgs e) { JobBAL jobBal = new JobBAL(); var table = jobBal.SearchJobs( Convert.ToInt32(DropDownListCity.SelectedValue), Convert.ToInt32(Session["JobCategoryId"]) ); GridViewJobs.DataSource = table; GridViewJobs.DataBind(); LabelHidden.InnerText = "divViewJobs"; }
protected void ButtonSubmit_Click(object sender, EventArgs e) { var jobBal = new JobBAL(); if ( jobBal.AddJobs( TextBoxJobName.Text, Convert.ToInt32(Session["UserId"]), Convert.ToInt32(DropDownListJobCategory.SelectedValue) ) ) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "alert('Added Successfully!');", true); PopulateGridViewDisplayJobDetails(Convert.ToInt32(Session["UserId"])); LabelHidden.InnerText = "divViewJobs"; } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "alert('Added Successfully!');", true); LabelHidden.InnerText = "divAddJobs"; } }