private void AssignvaluesToUserControl(DataTable dt) { try { //RadComboBox RadBusinessUnit = (RadComboBox)BU1.FindControl("RadBusinessUnit"); RadBusinessUnit.DataSource = dt; RadBusinessUnit.DataTextField = "BUSINESSUNIT_CODE"; RadBusinessUnit.DataValueField = "BUSINESSUNIT_ID"; RadBusinessUnit.DataBind(); //RadComboBox RadDirectorate = (RadComboBox)BU1.FindControl("RadDirectorate"); RadDirectorate.DataSource = dt; RadDirectorate.DataTextField = "DIRECTORATE_CODE"; RadDirectorate.DataValueField = "DIRECTORATE_ID"; RadDirectorate.DataBind(); //RadComboBox RadDepartment = (RadComboBox)BU1.FindControl("RadDepartment"); RadDepartment.DataSource = dt; RadDepartment.DataTextField = "DEPARTMENT_NAME"; RadDepartment.DataValueField = "DEPARTMENT_ID"; RadDepartment.DataBind(); //RadComboBox RadEmployee = (RadComboBox)BU1.FindControl("RadEmployee"); RadEmployee.DataSource = dt; RadEmployee.DataTextField = "EMP_NAME"; RadEmployee.DataValueField = "EMP_ID"; RadEmployee.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_employeescheme", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void BindDirectorate(DataTable dt) { RadDirectorate.DataSource = dt; RadDirectorate.DataTextField = "DIRECTORATE_CODE"; RadDirectorate.DataValueField = "DIRECTORATE_ID"; RadDirectorate.DataBind(); RadDirectorate.Items.Insert(0, new RadComboBoxItem("Select")); }
protected void RadBusinessUnit_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (RadBusinessUnit.SelectedIndex > 0) { DataSet ds = BLL.GetPensionEmployeeFilterDtls(Convert.ToInt32(Session["ORG_ID"]), Convert.ToInt32(RadBusinessUnit.SelectedValue), null, null, operation.Select); BindDirectorate(ds.Tables[1]); //BindDepartment(ds.Tables[2]); //To populate employee details BindEmployee(ds.Tables[3]); //To clear Departments RadDepartment.Items.Clear(); RadDepartment.ClearSelection(); RadDepartment.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } else { RadDirectorate.Items.Clear(); RadDirectorate.ClearSelection(); RadDirectorate.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("ALL", "0")); RadDepartment.Items.Clear(); RadDepartment.ClearSelection(); RadDepartment.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("ALL", "0")); //RadEmployee.Items.Clear(); //RadEmployee.ClearSelection(); DataSet ds = BLL.GetPensionEmployeeFilterDtls(Convert.ToInt32(Session["ORG_ID"]), null, null, null, operation.Select); //To populate employee details BindEmployee(ds.Tables[3]); //RadComboBox rcbparent = (RadComboBox)Parent.FindControl("radGradeName"); //if (rcbparent != null) //{ // rcbparent.Items.Clear(); // rcbparent.ClearSelection(); //} } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_employeescheme", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void BindDirectorate(DataTable dt) { try { RadDirectorate.DataSource = dt; RadDirectorate.DataTextField = "DIRECTORATE_CODE"; RadDirectorate.DataValueField = "DIRECTORATE_ID"; RadDirectorate.DataBind(); RadDirectorate.Items.Insert(0, new RadComboBoxItem("Select")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_employeescheme", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void RadBusinessUnit_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (RadBusinessUnit.SelectedIndex > 0) { DataSet ds = BLL.GetEmployeeFilterDetails(organisationID, Convert.ToInt32(RadBusinessUnit.SelectedValue), null, null); BindDirectorate(ds.Tables[1]); //BindDepartment(ds.Tables[2]); //To populate employee details BindEmployee(ds.Tables[3]); //To clear Departments RadDepartment.Items.Clear(); RadDepartment.ClearSelection(); } else { RadDirectorate.Items.Clear(); RadDirectorate.ClearSelection(); RadDirectorate.Text = string.Empty; RadDepartment.Items.Clear(); RadDepartment.ClearSelection(); RadDepartment.Text = string.Empty; RadEmployee.Items.Clear(); RadEmployee.ClearSelection(); RadEmployee.Text = string.Empty; RadComboBox rcbparent = (RadComboBox)Parent.FindControl("radGradeName"); if (rcbparent != null) { rcbparent.Items.Clear(); rcbparent.ClearSelection(); } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "BUFilter", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }