//Bind Class #region [Bind Class] private void BindClass(DropDownList ddlBranch, DropDownList ddlClass) { try { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = ddlBranch.SelectedValue.ToString(); if (!objEWA.BranchId.Equals("-1")) { objEWA.OrgId = Session["OrgId"].ToString();// Session["OrgId"].ToString(); DataSet ds = objBL.BindClass_BL(objEWA); ddlClass.DataSource = ds; ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "ClassId"; ddlClass.DataBind(); ddlClass.Items.Insert(0, new ListItem("Select", "-1")); } else { ddlClass.Items.Clear(); ddlClass.Items.Insert(0, new ListItem("Select", "-1")); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
private void BindClass() { try { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = ddlBranch.SelectedValue.ToString(); if (!objEWA.BranchId.Equals("Select")) { DataSet ds = objBL.BindClass_BL(objEWA); ddlClass.DataSource = ds; if (ds.Tables[0].Rows.Count != 0) { ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "ClassId"; ddlClass.DataBind(); } else { ddlClass.Items.Clear(); } } else { ddlClass.Items.Clear(); } ddlClass.Items.Insert(0, new ListItem("Select", "0")); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Bind Class #region [Bind Class] private void BindClass() { try { EWA_Common ObjEWA = new EWA_Common(); BL_Common ObjBL = new BL_Common(); ObjEWA.BranchId = ddlBranch.SelectedValue.ToString(); if (!ObjEWA.BranchId.Equals("Select")) { DataSet ds = ObjBL.BindClass_BL(ObjEWA); ddlClass.DataSource = ds; ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "ClassId"; ddlClass.DataBind(); ddlClass.Items.Insert(0, "Select"); } else { ddlClass.Items.Clear(); ddlClass.Items.Insert(0, "Select"); } ddlAcademicYear.SelectedIndex = 0; ddlCastCategory.SelectedIndex = 0; } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Branches Index Changed #region [Branches Index Changed] protected void ddlBranches_SelectedIndexChanged(object sender, EventArgs e) { try { objEWA.BranchId = ddlBranches.SelectedValue; DataSet ds = objBL.BindClass_BL(objEWA); ddlClasses.DataSource = ds; ddlClasses.DataTextField = "ClassName"; ddlClasses.DataValueField = "ClassId"; ddlClasses.DataBind(); ddlClasses.Items.Insert(0, "Select"); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
private DataTable BindClass_Grid(string branchid) { DataSet ds = new DataSet(); try { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = branchid; if (!objEWA.BranchId.Equals("Select")) { ds = objBL.BindClass_BL(objEWA); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } return(ds.Tables[0]); }
//Bind Classes #region Bind Class private void BindClass() { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = ddlBranch.SelectedValue.ToString(); if (!objEWA.BranchId.Equals("Select")) { DataSet ds = objBL.BindClass_BL(objEWA); ddlClass.DataSource = ds; ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "ClassId"; ddlClass.DataBind(); } else { ddlClass.Items.Clear(); } ddlClass.Items.Insert(0, new ListItem("Select", "Select")); }
//Get Class #region [Get Class] private void Getclass() { try { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = ddlbranch.SelectedValue; DataSet ds = new DataSet(); ds = objBL.BindClass_BL(objEWA); ddlclass.DataSource = ds.Tables[0]; ddlclass.DataTextField = "ClassName"; ddlclass.DataValueField = "ClassId"; ddlclass.DataBind(); ddlclass.Items.Insert(0, "Select"); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Bind Classes #region [Bind Classes] private void BindClasses() { try { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = ddlBranches.SelectedValue; DataSet ds = objBL.BindClass_BL(objEWA); ddlClasses.DataSource = ds; ddlClasses.DataTextField = "ClassName"; ddlClasses.DataValueField = "ClassId"; ddlClasses.DataBind(); ddlClasses.Items.Insert(0, new ListItem("Select", "0")); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Branch Index Changed #region [Branch Index Changed] protected void ddl_Branch_SelectedIndexChanged(object sender, EventArgs e) { try { EWA_Common objEWA = new EWA_Common(); BL_Common objBL = new BL_Common(); objEWA.BranchId = ddl_Branch.SelectedValue.ToString(); ds = objBL.BindClass_BL(objEWA); ddl_Class.DataSource = ds; ddl_Class.DataTextField = "ClassName"; ddl_Class.DataValueField = "ClassId"; ddl_Class.DataBind(); ddl_Class.Items.Insert(0, "Select"); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }