示例#1
0
 private void showQuestion()
 {
     if (Request.QueryString["Qid"] != null)
     {
         string qid = Request.QueryString["Qid"].ToString();
         LearnSite.Model.SurveyQuestion qmodel = new LearnSite.Model.SurveyQuestion();
         LearnSite.BLL.SurveyQuestion   qbll   = new LearnSite.BLL.SurveyQuestion();
         qmodel             = qbll.GetModel(Int32.Parse(qid));
         mcontent.InnerText = HttpUtility.HtmlDecode(qmodel.Qtitle);
         Btnadd.Text        = "修改试题";
     }
 }
示例#2
0
 protected void Btnadd_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null)
     {
         string fckstr = LearnSite.Common.WordProcess.ClearPP(mcontent.InnerText);
         if (fckstr.Length > 2)
         {
             int cid = Int32.Parse(Request.QueryString["Cid"].ToString());
             int vid = Int32.Parse(Request.QueryString["Vid"].ToString());
             LearnSite.Model.SurveyQuestion qmodel = new LearnSite.Model.SurveyQuestion();
             qmodel.Qcid   = cid;
             qmodel.Qcount = 0;
             string Qtitle = HttpUtility.HtmlEncode(fckstr);
             qmodel.Qtitle = Qtitle;
             qmodel.Qvid   = vid;
             LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion();
             if (Request.QueryString["Qid"] != null)
             {
                 int Qid = Int32.Parse(Request.QueryString["Qid"].ToString());
                 qbll.UpdateQtitle(Qid, Qtitle);
                 System.Threading.Thread.Sleep(200);
                 string url = "~/Survey/survey.aspx?Cid=" + cid + "&Vid=" + vid;
                 Response.Redirect(url, true);
             }
             else
             {
                 qbll.Add(qmodel);
                 System.Threading.Thread.Sleep(200);
                 string url = "~/Survey/survey.aspx?Cid=" + cid + "&Vid=" + vid;
                 Response.Redirect(url, true);
             }
         }
         else
         {
             Labelmsg.Text = "调查试题文字太少!";
         }
     }
 }
示例#3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LearnSite.Model.SurveyQuestion> DataTableToList(DataTable dt)
        {
            List <LearnSite.Model.SurveyQuestion> modelList = new List <LearnSite.Model.SurveyQuestion>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LearnSite.Model.SurveyQuestion model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LearnSite.Model.SurveyQuestion();
                    if (dt.Rows[n]["Qid"] != null && dt.Rows[n]["Qid"].ToString() != "")
                    {
                        model.Qid = int.Parse(dt.Rows[n]["Qid"].ToString());
                    }
                    if (dt.Rows[n]["Qvid"] != null && dt.Rows[n]["Qvid"].ToString() != "")
                    {
                        model.Qvid = int.Parse(dt.Rows[n]["Qvid"].ToString());
                    }
                    if (dt.Rows[n]["Qcid"] != null && dt.Rows[n]["Qcid"].ToString() != "")
                    {
                        model.Qcid = int.Parse(dt.Rows[n]["Qcid"].ToString());
                    }
                    if (dt.Rows[n]["Qtitle"] != null && dt.Rows[n]["Qtitle"].ToString() != "")
                    {
                        model.Qtitle = dt.Rows[n]["Qtitle"].ToString();
                    }
                    if (dt.Rows[n]["Qcount"] != null && dt.Rows[n]["Qcount"].ToString() != "")
                    {
                        model.Qcount = int.Parse(dt.Rows[n]["Qcount"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LearnSite.Model.SurveyQuestion model)
 {
     return(dal.Update(model));
 }
示例#5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LearnSite.Model.SurveyQuestion model)
 {
     return(dal.Add(model));
 }