Beispiel #1
0
 private void showquestion()
 {
     if (Request.QueryString["Qid"] != null)
     {
         string Mqid = Request.QueryString["Qid"].ToString();
         LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion();
         LabelQtitle.Text = HttpUtility.HtmlDecode(qbll.GetTitle(Int32.Parse(Mqid)));
     }
 }
 private void showQuestion()
 {
     if (Request.QueryString["Vid"] != null)
     {
         string qvid = Request.QueryString["Vid"].ToString();
         LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion();
         DataListonly.DataSource = qbll.GetListByQvid(Int32.Parse(qvid));
         DataListonly.DataBind();
     }
 }
Beispiel #3
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        = "修改试题";
     }
 }
Beispiel #4
0
 protected void GVQuestion_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         string Qid = e.CommandArgument.ToString();
         LearnSite.BLL.SurveyItem mbll = new LearnSite.BLL.SurveyItem();
         mbll.DelAllMqid(Int32.Parse(Qid));
         LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion();
         qbll.Delete(Int32.Parse(Qid));
         System.Threading.Thread.Sleep(200);
         showquestion();
         showCalculate();
         showsurvey();
     }
 }
Beispiel #5
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 = "调查试题文字太少!";
         }
     }
 }
Beispiel #6
0
    protected void GVlistmenu_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int    RowIndex = Convert.ToInt32(e.CommandArgument);
        int    Lid      = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLid")).Text);
        int    lxid     = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLxid")).Text);
        string ltype    = ((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLtype")).Text;
        //int lsort = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLsort")).Text);
        int Lcid = Int32.Parse(Request.QueryString["Cid"].ToString());

        LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu();
        if (e.CommandName == "P")
        {
            switch (ltype)
            {
            case "1":    //活动
            case "5":    //编程
            case "6":    //描述
                LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
                mbll.UpdateMpublish(lxid);
                lbll.UpdateLshow(Lid);
                break;

            case "2":    //调查
                LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey();
                vbll.UpdateVclose(lxid);
                lbll.UpdateLshow(Lid);
                break;

            case "3":    //讨论
                LearnSite.BLL.TopicDiscuss tbll = new LearnSite.BLL.TopicDiscuss();
                tbll.UpdateTclose(lxid);
                lbll.UpdateLshow(Lid);
                break;

            case "4":    //表单
                LearnSite.BLL.TxtForm tbmbll = new LearnSite.BLL.TxtForm();
                tbmbll.UpdateMpublish(lxid);
                lbll.UpdateLshow(Lid);
                break;
            }
        }
        if (e.CommandName == "D")
        {
            switch (ltype)
            {
            case "1":                     //活动
            case "5":                     //编程
            case "6":                     //描述
                LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
                mbll.DeleteMission(lxid); //假删除任务
                lbll.Delete(Lid);         //删除导航
                break;

            case "2":    //调查
                LearnSite.BLL.Survey         vbll = new LearnSite.BLL.Survey();
                LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion();
                if (!qbll.ExistsByQvid(lxid))
                {
                    vbll.Delete(lxid);   //删除调查
                    lbll.Delete(Lid);    //删除导航
                }
                else
                {
                    string msg = "该调查卷存在试题,请先删除试题!";
                    LearnSite.Common.WordProcess.Alert(msg, this.Page);
                }
                break;

            case "3":              //讨论
                LearnSite.BLL.TopicDiscuss tbll = new LearnSite.BLL.TopicDiscuss();
                tbll.Delete(lxid); //删除讨论
                lbll.Delete(Lid);  //删除导航
                break;

            case "4":                //表单
                LearnSite.BLL.TxtForm tfmbll = new LearnSite.BLL.TxtForm();
                tfmbll.Delete(lxid); //删除表单
                lbll.Delete(Lid);    //删除导航
                break;
            }
        }

        if (e.CommandName == "Top")
        {
            if (RowIndex == 0)
            {
                lbll.Lsortnew(Lcid);//如果首行,初始化序号
            }
            if (RowIndex > 0)
            {
                int toplid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex - 1].FindControl("LabelLid")).Text); //获取上个导航编号
                lbll.UpdateLsort(Lid, false);                                                                      //当前导航减1向上
                lbll.UpdateLsort(toplid, true);                                                                    //上个导航增1向下
            }
            System.Threading.Thread.Sleep(500);
            lbll.UpdateMissonListMene(Lcid, lxid);//活动序号同步
        }
        if (e.CommandName == "Bottom")
        {
            int rowscount = GVlistmenu.Rows.Count;
            if (RowIndex < rowscount - 1)
            {
                int bottomlid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex + 1].FindControl("LabelLid")).Text); //获取下个导航编号
                lbll.UpdateLsort(bottomlid, false);                                                                   //下个导航减1向上
                lbll.UpdateLsort(Lid, true);                                                                          //当前导航增1向下
                System.Threading.Thread.Sleep(500);
                lbll.UpdateMissonListMene(Lcid, lxid);                                                                //活动序号同步
            }
        }

        System.Threading.Thread.Sleep(200);
        showmenu();
    }