示例#1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<LearnSite.Model.Flection> DataTableToList(DataTable dt)
 {
     List<LearnSite.Model.Flection> modelList = new List<LearnSite.Model.Flection>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         LearnSite.Model.Flection model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new LearnSite.Model.Flection();
             if(dt.Rows[n]["Fid"].ToString()!="")
             {
                 model.Fid=int.Parse(dt.Rows[n]["Fid"].ToString());
             }
             if(dt.Rows[n]["Fcid"].ToString()!="")
             {
                 model.Fcid=int.Parse(dt.Rows[n]["Fcid"].ToString());
             }
             if(dt.Rows[n]["Fhid"].ToString()!="")
             {
                 model.Fhid=int.Parse(dt.Rows[n]["Fhid"].ToString());
             }
             model.Fcontent=dt.Rows[n]["Fcontent"].ToString();
             if(dt.Rows[n]["Fdate"].ToString()!="")
             {
                 model.Fdate=DateTime.Parse(dt.Rows[n]["Fdate"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
示例#2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LearnSite.Model.Flection> DataTableToList(DataTable dt)
        {
            List <LearnSite.Model.Flection> modelList = new List <LearnSite.Model.Flection>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LearnSite.Model.Flection model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LearnSite.Model.Flection();
                    if (dt.Rows[n]["Fid"].ToString() != "")
                    {
                        model.Fid = int.Parse(dt.Rows[n]["Fid"].ToString());
                    }
                    if (dt.Rows[n]["Fcid"].ToString() != "")
                    {
                        model.Fcid = int.Parse(dt.Rows[n]["Fcid"].ToString());
                    }
                    if (dt.Rows[n]["Fhid"].ToString() != "")
                    {
                        model.Fhid = int.Parse(dt.Rows[n]["Fhid"].ToString());
                    }
                    model.Fcontent = dt.Rows[n]["Fcontent"].ToString();
                    if (dt.Rows[n]["Fdate"].ToString() != "")
                    {
                        model.Fdate = DateTime.Parse(dt.Rows[n]["Fdate"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#3
0
 private void Showthink()
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Fcid = Request.QueryString["Cid"].ToString();
         LearnSite.Model.Flection flection = new LearnSite.Model.Flection();
         LearnSite.BLL.Flection flectionbll = new LearnSite.BLL.Flection();
         flection = flectionbll.GetModel(Int32.Parse(Fcid));
         LearnSite.BLL.Courses cs = new LearnSite.BLL.Courses();
         Texttitle.Text = cs.GetTitle(Int32.Parse(Fcid));
         FCKeditor1.Value = HttpUtility.HtmlDecode(flection.Fcontent);
     }
 }
示例#4
0
 private void Showthink()
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Fcid = Request.QueryString["Cid"].ToString();
         LearnSite.Model.Flection flection    = new LearnSite.Model.Flection();
         LearnSite.BLL.Flection   flectionbll = new LearnSite.BLL.Flection();
         flection = flectionbll.GetModel(Int32.Parse(Fcid));
         LearnSite.BLL.Courses cs = new LearnSite.BLL.Courses();
         Texttitle.Text     = cs.GetTitle(Int32.Parse(Fcid));
         mcontent.InnerText = HttpUtility.HtmlDecode(flection.Fcontent);
     }
 }
示例#5
0
 protected void BtnEdit_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Fcid     = Request.QueryString["Cid"].ToString();
         string Fcontent = HttpUtility.HtmlEncode(mcontent.InnerText);
         Labelmsg.Text = "添加反思成功";
         LearnSite.Model.Flection flection = new LearnSite.Model.Flection();
         flection.Fcid     = Int32.Parse(Fcid);
         flection.Fcontent = Fcontent;
         LearnSite.BLL.Flection flectionbll = new LearnSite.BLL.Flection();
         flectionbll.Update(flection);
         System.Threading.Thread.Sleep(500);
         string url = "~/Lessons/thinkshow.aspx?Cid=" + Int32.Parse(Fcid);
         Response.Redirect(url, false);
     }
 }
示例#6
0
 protected void Btnadd_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Fcid     = Request.QueryString["Cid"].ToString();
         string Fcontent = HttpUtility.HtmlEncode(Request.Form["textareaItem"].Trim());
         Labelmsg.Text = "添加反思成功";
         LearnSite.Model.Flection flection = new LearnSite.Model.Flection();
         flection.Fcontent = Fcontent;
         flection.Fdate    = DateTime.Now;
         flection.Fhid     = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname].Values["Hid"].ToString());//教师编号
         flection.Fcid     = Int32.Parse(Fcid);
         LearnSite.BLL.Flection flectionbll = new LearnSite.BLL.Flection();
         flectionbll.Add(flection);
         System.Threading.Thread.Sleep(500);
         string url = "~/Lessons/thinkshow.aspx?Cid=" + Int32.Parse(Fcid);
         Response.Redirect(url, false);
     }
 }
示例#7
0
 protected void BtnEdit_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Fcid = Request.QueryString["Cid"].ToString();
         string Fcontent = HttpUtility.HtmlEncode(FCKeditor1.Value);
         Labelmsg.Text = "添加反思成功";
         LearnSite.Model.Flection flection = new LearnSite.Model.Flection();
         flection.Fcid = Int32.Parse(Fcid);
         flection.Fcontent = Fcontent;
         LearnSite.BLL.Flection flectionbll = new LearnSite.BLL.Flection();
         flectionbll.Update(flection);
         this.Texttitle.Text = "";
         this.FCKeditor1.Value = "";
         System.Threading.Thread.Sleep(1000);
         string url = "~/Lessons/thinkshow.aspx?Cid=" + Int32.Parse(Fcid);
         Response.Redirect(url, false);
     }
 }
示例#8
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LearnSite.Model.Flection model)
 {
     dal.Update(model);
 }
示例#9
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LearnSite.Model.Flection model)
 {
     return(dal.Add(model));
 }