示例#1
0
        private void SetDisplay(string courseId)
        {
            quTime.Visible = false;
            var queBll = new BLL.Questionnaire();
            var ds = queBll.GetCourseQuestionnarieInfo(Profile.CurrentUser.UserId);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 1)
                {
                    btnSubmit.ImageUrl = "~/images/regist2.jpg";
                }
                else
                {
                    btnSubmit.ImageUrl = "~/images/regist1.jpg";
                }
            }
            else
            {
                btnSubmit.ImageUrl = "~/images/regist1.jpg";
            }
            if (!string.IsNullOrEmpty(courseId))  //点击后传过来的
            {
                var course = new BLL.Course();
                var couModel = course.GetModel(new Guid(courseId));
                // coName.InnerText = couModel.CourseName;
                hCouseId.Value = couModel.CourseId.ToString();
                ipCourseName.InnerText = couModel.CourseName;
                ipPlace.InnerText = couModel.TeachPlace;
                ipTeacher.InnerText = couModel.TeacherName;
                ipTime.InnerText = couModel.TeachTime;

                // GetTheLeft();
                quNo.Visible = false;
                queHas.Visible = true;
                //   queHas1.Visible = true;
            }
            else
            {
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    hCouseId.Value = ds.Tables[0].Rows[0]["CourseId"].ToString();

                    //  coName.InnerText = ds.Tables[0].Rows[0]["CourseName"].ToString();
                    //var sb = new StringBuilder();
                    //var i = 0;
                    //foreach (DataRow row in ds.Tables[0].Rows)
                    //{
                    //    i++;
                    //    sb.Append("<span onclick='toOther(\"" + row["CourseId"] + "\")'  style='cursor: pointer'>");
                    //    sb.Append(i + "、");
                    //    sb.Append(row["CourseName"]);
                    //    sb.Append(@"</span>");
                    //    sb.Append(@"<br/><br/>");
                    //}
                    //  CourseNames.InnerHtml = sb.ToString();

                    ipCourseName.InnerText = ds.Tables[0].Rows[0]["CourseName"].ToString();
                    ipPlace.InnerText = ds.Tables[0].Rows[0]["TeachPlace"].ToString();
                    ipTeacher.InnerText = ds.Tables[0].Rows[0]["TeacherName"].ToString();
                    ipTime.InnerText = ds.Tables[0].Rows[0]["TeachTime"].ToString();

                    quNo.Visible = false;
                    queHas.Visible = true;
                    //      queHas1.Visible = true;
                }
                else
                {
                    quNo.Visible = true;
                    queHas.Visible = false;
                    //    queHas1.Visible = false;
                    //Response.Redirect("");
                }
            }
        }
示例#2
0
 private void GetTheLeft()
 {
     var queBll = new BLL.Questionnaire();
     var ds = queBll.GetCourseQuestionnarieInfo(Profile.CurrentUser.UserId);
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         var sb = new StringBuilder();
         var i = 0;
         foreach (DataRow row in ds.Tables[0].Rows)
         {
             i++;
             sb.Append("<span onclick='toOther(\"" + row["CourseId"] + "\")'  style='cursor: pointer'>");
             sb.Append(i + "、");
             sb.Append(row["CourseName"]);
             sb.Append(@"</span>");
             sb.Append(@"<br/><br/>");
         }
         CourseNames.InnerHtml = sb.ToString();
     }
 }