Exemplo n.º 1
0
        private void BindCoursewareGrid()
        {
            CoursewareBLL coursewareBLL = new CoursewareBLL();
            IList <RailExam.Model.Courseware> coursewares = new List <RailExam.Model.Courseware>();

            string strKnowledgeID = Request.QueryString.Get("id");
            IList <RailExam.Model.Book> bookList = new List <RailExam.Model.Book>();

            if (strKnowledgeID != null & strKnowledgeID != "" & strKnowledgeID != "0")
            {
                coursewares = coursewareBLL.GetCoursewaresByCoursewareTypeID(Convert.ToInt32(strKnowledgeID), 1);
            }

            string strtypeID = Request.QueryString.Get("id1");

            if (strtypeID != null & strtypeID != "" && strtypeID != "0")
            {
                coursewares = coursewareBLL.GetCoursewaresByTrainTypeID(Convert.ToInt32(strtypeID), 1);
            }

            foreach (RailExam.Model.Courseware courseware in coursewares)
            {
                courseware.CoursewareName = "<a onclick=OpenCourse('" + courseware.CoursewareID + "')  href=#  title=" + courseware.CoursewareName + ">" + courseware.CoursewareName + "</a>";
            }
            Grid2.DataSource = coursewares;
            Grid2.DataBind();
        }
Exemplo n.º 2
0
        private void BindGrid()
        {
            string strIDPath = Request.QueryString["id"];

            CoursewareBLL coursewareBLL = new CoursewareBLL();
            IList <RailExam.Model.Courseware> coursewares = new List <RailExam.Model.Courseware>();

            if (Request.QueryString.Get("type") == "Courseware")
            {
                coursewares = coursewareBLL.GetCoursewaresByCoursewareTypeID(Convert.ToInt32(strIDPath), 1);
            }
            else
            {
                coursewares = coursewareBLL.GetCoursewaresByTrainTypeID(Convert.ToInt32(strIDPath), 1);
            }

            foreach (RailExam.Model.Courseware courseware in coursewares)
            {
                //if (courseware.CoursewareName.Length <= 15)
                //{
                courseware.CoursewareName = "<a onclick=OpenIndex('" + courseware.CoursewareID + "')  href=#  title=" + courseware.CoursewareName + ">" + courseware.CoursewareName + "</a>";
                //}
                //else
                //{
                //    courseware.CoursewareName = "<a onclick=OpenIndex('" + courseware.Url + "')  href=#  title=" + courseware.CoursewareName + ">" + courseware.CoursewareName.Substring(0, 15) + "...</a>";
                //}
            }
            Grid1.DataSource = coursewares;
            Grid1.DataBind();
        }
Exemplo n.º 3
0
        private void BindGrid()
        {
            string strIDPath = Request.QueryString["id"];

            CoursewareBLL coursewareBLL = new CoursewareBLL();
            IList <RailExam.Model.Courseware> coursewares = new List <RailExam.Model.Courseware>();

            OrganizationBLL orgBll = new OrganizationBLL();
            int             orgID  = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID);

            if (Request.QueryString.Get("type") == "Courseware")
            {
                coursewares = coursewareBLL.GetCoursewaresByCoursewareTypeID(Convert.ToInt32(strIDPath), orgID);
            }
            else if (Request.QueryString.Get("type") == "TrainType")
            {
                coursewares = coursewareBLL.GetCoursewaresByTrainTypeID(Convert.ToInt32(strIDPath), orgID);
            }
            else
            {
                coursewares = coursewareBLL.GetCoursewaresByPostID(Convert.ToInt32(strIDPath), orgID);
            }

            if (coursewares != null)
            {
                foreach (RailExam.Model.Courseware obj in coursewares)
                {
                    if (obj.CoursewareName.Length <= 20)
                    {
                        obj.CoursewareName = "<a onclick=OpenIndex('" + obj.CoursewareID + "') href=# title=" + obj.CoursewareName + " > " + obj.CoursewareName + " </a>";
                    }
                    else
                    {
                        obj.CoursewareName = "<a onclick=OpenIndex('" + obj.CoursewareID + "') href=# title=" + obj.CoursewareName + " > " + obj.CoursewareName.Substring(0, 20) + "...</a>";
                    }
                }

                Grid1.DataSource = coursewares;
                Grid1.DataBind();
            }
        }
Exemplo n.º 4
0
        private void BindGrid()
        {
            string strIDPath = Request.QueryString["id"];

            CoursewareBLL coursewareBLL = new CoursewareBLL();
            IList <RailExam.Model.Courseware> coursewares = new List <RailExam.Model.Courseware>();

            OrganizationBLL orgBll = new OrganizationBLL();
            int             orgID  = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID);

            if (Request.QueryString.Get("type") == "Courseware")
            {
                coursewares = coursewareBLL.GetCoursewaresByCoursewareTypeID(Convert.ToInt32(strIDPath), orgID);
            }
            else
            {
                coursewares = coursewareBLL.GetCoursewaresByTrainTypeID(Convert.ToInt32(strIDPath), orgID);
            }

            OracleAccess oa           = new OracleAccess();
            int          railSystemid = PrjPub.RailSystemId();

            if (railSystemid != 0)
            {
                IList <RailExam.Model.Courseware> coursewaresVia = new List <RailExam.Model.Courseware>();
                string sql = String.Format(
                    @"select courseware_id from courseware_RANGE_ORG t 
                        where 
                            org_Id in (select org_id from org where rail_System_Id={0} and level_num=2) ",
                    railSystemid
                    );

                DataSet dscoursewareIDs = oa.RunSqlDataSet(sql);
                if (dscoursewareIDs != null && dscoursewareIDs.Tables.Count > 0)
                {
                    foreach (RailExam.Model.Courseware courseware in coursewares)
                    {
                        DataRow[] drs = dscoursewareIDs.Tables[0].Select("courseware_id=" + courseware.CoursewareID);
                        if (drs.Length > 0)
                        {
                            coursewaresVia.Add(courseware);
                        }
                    }
                    coursewares.Clear();
                    coursewares = coursewaresVia;
                }
            }

            if (coursewares != null)
            {
                foreach (RailExam.Model.Courseware obj in coursewares)
                {
                    if (obj.CoursewareName.Length <= 20)
                    {
                        obj.CoursewareName = "<a onclick=OpenIndex('" + obj.CoursewareID + "') href=# title=" + obj.CoursewareName + " > " + obj.CoursewareName + " </a>";
                    }
                    else
                    {
                        obj.CoursewareName = "<a onclick=OpenIndex('" + obj.CoursewareID + "') href=# title=" + obj.CoursewareName + " > " + obj.CoursewareName.Substring(0, 20) + "...</a>";
                    }
                }

                Grid1.DataSource = coursewares;
                Grid1.DataBind();
            }
        }