//Bind Subject
        #region [Bind Subjects]

        private void BindSubject()
        {
            try
            {
                EWA_Common objEWA = new EWA_Common();
                BL_Common  objBL  = new BL_Common();
                objEWA.CourseId = ddlCourses.SelectedValue;
                objEWA.BranchId = ddlBranches.SelectedValue;
                objEWA.ClassId  = ddlClasses.SelectedValue;
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.UserCode = Session["Username"].ToString();

                DataSet ds = objBL.BindAssigned_Subject_BL(objEWA);

                ddlSelectSubject.DataSource = ds;

                ddlSelectSubject.DataTextField  = "SubjectName";
                ddlSelectSubject.DataValueField = "SubjectId";
                ddlSelectSubject.DataBind();
                ddlSelectSubject.Items.Insert(0, new ListItem("Select", "0"));
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
示例#2
0
        private void BindSubject()
        {
            try
            {
                EWA_Common objEWA = new EWA_Common();
                BL_Common  objBL  = new BL_Common();
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.UserCode = Session["Username"].ToString();
                objEWA.CourseId = ddlCourse.SelectedValue.ToString();
                objEWA.BranchId = ddlBranch.SelectedValue.ToString();
                objEWA.ClassId  = ddlClass.SelectedValue.ToString();
                // if (!objEWA.ClassId.Equals("Select"))
                {
                    DataSet ds = objBL.BindAssigned_Subject_BL(objEWA);

                    drpSubject.DataSource = ds;
                    if (ds.Tables[0].Rows.Count != 0)
                    {
                        drpSubject.DataTextField  = "SubjectName";
                        drpSubject.DataValueField = "SubjectId";
                        drpSubject.DataBind();
                    }
                    else
                    {
                        drpSubject.Items.Clear();
                    }
                }
                //else
                //{
                //    drpSubject.Items.Clear();
                //}
                drpSubject.Items.Insert(0, new ListItem("Select", "0"));
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
示例#3
0
        private DataTable BindSubject_Grid(string courseid, string branchid, string classid)
        {
            DataSet ds = new DataSet();

            try
            {
                EWA_Common objEWA = new EWA_Common();
                BL_Common  objBL  = new BL_Common();
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.UserCode = Session["Username"].ToString();
                objEWA.CourseId = courseid; // ddlCourse.SelectedValue;
                objEWA.BranchId = branchid; // ddlBranch.SelectedValue;
                objEWA.ClassId  = classid;  // ddlClass.SelectedValue;
                //if (!objEWA.ClassId.Equals("Select"))
                {
                    ds = objBL.BindAssigned_Subject_BL(objEWA);
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
            return(ds.Tables[0]);
        }