Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["xx"] != null)
     {
         xx = Convert.ToInt32(Request.QueryString["xx"]);
     }
     //进入页面后 首先加载出第一个单词的信息
     if (xx < 2)
     {
         if (Session["ID"] != null)
         {
             if (Session["c_id"] == null)
             {
                 Session["c_id"] = 1;
             }
             UserCollect_Bll uc_b = new UserCollect_Bll();
             UserCollect     uc   = new UserCollect();
             uc          = uc_b.GetUserCollect(Convert.ToInt32(Session["ID"]));
             GetCourseID = uc.C_ID;
             CourseDetail_Bll cd_b = new CourseDetail_Bll();
             CourseDetails    cd   = new CourseDetails();
             cd = cd_b.QueryCourseDetails1(GetCourseID);
             Session["c_id"] = GetCourseID;
             Words_ID        = cd.CD_ID;
             xx = Words_ID;
             Session["cd_id"]             = Words_ID;
             Words_name                   = cd.CD_NAME;
             Learning_Words.Text          = Words_name;
             Learning_Words_Sentence.Text = cd.CD_SENEng;
             Pic_1.ImageUrl               = "getpic1.aspx?cd_id=" + Words_ID;
             Pic_2.ImageUrl               = "getpic2.aspx?cd_id=" + Words_ID;
             Pic_3.ImageUrl               = "getpic3.aspx?cd_id=" + Words_ID;
             Pic_4.ImageUrl               = "getpic4.aspx?cd_id=" + Words_ID;
         }
     }
     else
     {
         UserCollect_Bll uc_b = new UserCollect_Bll();
         UserCollect     uc   = new UserCollect();
         uc          = uc_b.GetUserCollect(Convert.ToInt32(Session["ID"]));
         GetCourseID = uc.C_ID;
         CourseDetail_Bll cd_b = new CourseDetail_Bll();
         CourseDetails    cd   = new CourseDetails();
         cd = cd_b.QueryCourseDetails1(GetCourseID, xx);
         Session["c_id"]              = GetCourseID;
         Words_ID                     = cd.CD_ID;
         Session["cd_id"]             = Words_ID;
         Words_name                   = cd.CD_NAME;
         Learning_Words.Text          = Words_name;
         Learning_Words_Sentence.Text = cd.CD_SENEng;
         Pic_1.ImageUrl               = "getpic1.aspx?cd_id=" + Words_ID;
         Pic_2.ImageUrl               = "getpic2.aspx?cd_id=" + Words_ID;
         Pic_3.ImageUrl               = "getpic3.aspx?cd_id=" + Words_ID;
         Pic_4.ImageUrl               = "getpic4.aspx?cd_id=" + Words_ID;
     }
 }
Ejemplo n.º 2
0
        public static int u_id; //用户ID
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                UserCollect_Bll uc_b = new UserCollect_Bll();
                Coures_Bll      cb   = new Coures_Bll();

                Button1.Attributes.Add("onmouseout", "this.src='Images/index_btn.png'");
                Button1.Attributes.Add("onmouseover", "this.src='Images/index_btn_hover.png'");

                u_id = Convert.ToInt32(Session["ID"].ToString());
                UserCollect uc = new UserCollect();
                uc   = uc_b.GetUserCollect(u_id);
                c_id = uc.C_ID;
                //Response.Write("<script>alert('" + c_id + "')</script>");

                lab_view.Text = cb.GetCourse(c_id).C_NAME.ToString();
                lab_view.DataBind(); //获取单词包名称

                Bind();              //剩余天数

                UserDownload     ud   = new UserDownload();
                UserDownload_Bll ud_b = new UserDownload_Bll();
                int count             = ud_b.GetCount(Convert.ToInt32(Session["ID"]), c_id);
                lab_view_finish.Text = count.ToString();
                lab_view_finish.DataBind();//完成单词数

                lab_view_number.Text = cb.GetCourse(c_id).C_vocabulary.ToString();
                lab_view_number.DataBind();//该单词包的总单词数

                DateTime now = DateTime.Now.Date;
                DateTime ts  = DateTime.Parse(uc_b.GetUserCollectUid(u_id).UC_StartDay.ToString()).Date;
                TimeSpan t1  = ts.Subtract(now);  //计算开始时间到结束时间天数差
                TimeSpan t2  = now.Subtract(now); //计算开始时间到结束时间天数差

                lab_xinxue.Text = "0";
                //if(t1!=t2)
                //{
                //    lab_xinxue.Text = "0";
                //}
                //else
                //{
                //    lab_xinxue.Text = Convert.ToString(Session["xinxue"].ToString());
                //}
                //获取今日新目标
                lab_view_words.Text = uc_b.GetUserCollectUid(u_id).UC_EveWord.ToString();
                lab_view_words.DataBind();//获取今日目标

                Users_Bll ub = new Users_Bll();
                Users     u  = new Users();
                u             = ub.GetUser(Convert.ToInt32(Session["ID"]));
                Lab_name.Text = u.U_NAME;
            }
        }