Beispiel #1
0
        //Class Changed
        #region [Class Changed]

        protected void ddlClass_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                EWA_Common ObjEWA = new EWA_Common();
                BL_Common  ObjBL  = new BL_Common();

                ObjEWA.OrgId    = Session["OrgId"].ToString();
                ObjEWA.CourseId = ddlCourse.SelectedValue.ToString();
                ObjEWA.ClassId  = ddlClass.SelectedValue.ToString();

                DataSet ds = ObjBL.BindSubject_BL(ObjEWA);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    ddlSubject.DataSource     = ds;
                    ddlSubject.DataTextField  = "SubjectName";
                    ddlSubject.DataValueField = "SubjectId";
                    ddlSubject.DataBind();
                }
                else
                {
                    ddlSubject.Items.Clear();
                }

                ddlSubject.Items.Insert(0, "Select");
                ddlSubject.SelectedIndex = 0;

                ShowEmptyGridView(GrdEmployee);
                ShowEmptyGridView(GrdViewEmployee);
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #2
0
        private void BindSubject()
        {
            try
            {
                EWA_Common ObjEWA = new EWA_Common();
                BL_Common  ObjBL  = new BL_Common();

                ObjEWA.OrgId    = Session["OrgId"].ToString();
                ObjEWA.CourseId = ddlCourse.SelectedValue.ToString();
                ObjEWA.ClassId  = ddlClass.SelectedValue.ToString();

                DataSet ds = ObjBL.BindSubject_BL(ObjEWA);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    ddlSubject.DataSource     = ds;
                    ddlSubject.DataTextField  = "SubjectName";
                    ddlSubject.DataValueField = "SubjectId";
                    ddlSubject.DataBind();
                }
                else
                {
                    ddlSubject.Items.Clear();
                }

                ddlSubject.Items.Insert(0, new ListItem("Select", "0"));
                ddlSubject.Items.Insert(1, new ListItem("Break", "501"));
                ddlSubject.SelectedIndex = 0;
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }