예제 #1
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null)
            {
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                string hidstr = tcook.Hid.ToString();
                //string serverUrl = LearnSite.Common.WordProcess.ServerUrl();
                //fckstr = fckstr.Replace(serverUrl, "");
                int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString());
                LearnSite.BLL.TopicDiscuss   bll   = new LearnSite.BLL.TopicDiscuss();
                LearnSite.Model.TopicDiscuss model = new LearnSite.Model.TopicDiscuss();
                model.Tcid     = Mcid;
                model.Ttitle   = Texttitle.Text.Trim();
                model.Tcontent = HttpUtility.HtmlEncode(fckstr);
                model.Tcount   = 0;
                model.Tteacher = Int32.Parse(hidstr);
                model.Tdate    = DateTime.Now;
                model.Tclose   = CheckPublish.Checked;
                model.Tresult  = "";
                int tid = bll.Add(model);

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();
                lmodel.Lcid   = Mcid;
                lmodel.Lshow  = true;
                lmodel.Lsort  = lbll.GetMaxLsort(Mcid) + 1;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 3;
                lmodel.Lxid   = tid;
                lbll.Add(lmodel);

                System.Threading.Thread.Sleep(500);
                //Labelmsg.Text = "添加主题讨论成功";
                string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString();
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
예제 #2
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null)
            {
                string Mcidstr = Request.QueryString["Mcid"].ToString();
                int    Mcid    = Int32.Parse(Mcidstr);
                LearnSite.BLL.TxtForm   tbll  = new LearnSite.BLL.TxtForm();
                LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm();
                LearnSite.BLL.ListMenu  lbll  = new LearnSite.BLL.ListMenu();
                int maxSort = lbll.GetMaxLsort(Mcid) + 1;
                tmode.Mcid     = Mcid;
                tmode.Mtitle   = Texttitle.Text.Trim();
                tmode.Mpublish = CheckPublish.Checked;
                tmode.Mcontent = HttpUtility.HtmlEncode(fckstr);
                tmode.Mdate    = DateTime.Now;
                tmode.Mhit     = 0;
                int mid = tbll.Add(tmode);
                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                lmodel.Lcid   = Mcid;
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Lsort  = maxSort;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 4;//表单类型为4
                lmodel.Lxid   = mid;
                lbll.Add(lmodel);
                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString();
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
예제 #3
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = mcontent.InnerText;

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Cid"] != null)
            {
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                string hidstr = tcook.Hid.ToString();
                int    Vcid   = Int32.Parse(Request.QueryString["Cid"].ToString());
                LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
                LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
                vmodel.Vcid     = Vcid;
                vmodel.Vclose   = CheckClose.Checked;
                vmodel.Vcontent = HttpUtility.HtmlEncode(fckstr);
                vmodel.Vdate    = DateTime.Now;
                vmodel.Vhid     = Int32.Parse(hidstr);
                bool vp = false;
                vmodel.Vpoint = vp;
                vmodel.Vtitle = Texttitle.Text.Trim();
                int Vtype = Int32.Parse(DDLvtype.SelectedValue);
                vmodel.Vtype = Vtype;
                //Vcid,Vhid,Vtitle,Vcontent,Vtype,Vclose,Vpoint,Vdate
                string url = "";

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();
                lmodel.Lcid   = Vcid;
                lmodel.Lshow  = true;
                lmodel.Lsort  = lbll.GetMaxLsort(Vcid) + 1;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 2;

                if (Request.QueryString["Vid"] != null)
                {
                    int vid = Int32.Parse(Request.QueryString["Vid"].ToString());
                    vmodel.Vid = vid;
                    vbll.UpdateSurvey(vmodel);      //更新到调查表中
                    lmodel.Lxid = vid;
                    lbll.UpdateLtitle(lmodel);      //更新到导航中
                    LearnSite.BLL.SurveyFeedback fkbll = new LearnSite.BLL.SurveyFeedback();
                    fkbll.UpdateFvtype(vid, Vtype); //2014-3-15修订,如果调查类型改变的话,同时也改变调查结果记录中的类型
                    url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + vid;

                    System.Threading.Thread.Sleep(500);
                }
                else
                {
                    int newvid = vbll.Addsurvey(vmodel); //增加到调查表中
                    lmodel.Lxid = newvid;
                    lbll.Add(lmodel);                    //增加到导航中
                    System.Threading.Thread.Sleep(500);
                    url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + newvid;
                }
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
예제 #4
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null)
            {
                string Mcidstr = Request.QueryString["Mcid"].ToString();
                int    Mcid    = Int32.Parse(Mcidstr);
                LearnSite.BLL.Mission  missionbll = new LearnSite.BLL.Mission();
                LearnSite.BLL.ListMenu lbll       = new LearnSite.BLL.ListMenu();
                int    maxSort    = lbll.GetMaxLsort(Mcid) + 1;
                string exampleurl = "~/Statics/cat.sb2";//实例路径
                if (Fupload.HasFile)
                {
                    string sbfilename    = Fupload.FileName;
                    string savePath      = LearnSite.Store.CourseStore.GetSaveUrl("Course", Mcidstr);
                    string shortFileName = Path.GetFileName(sbfilename);
                    string savefilename  = savePath + shortFileName;
                    string sbpath        = this.Server.MapPath(savefilename);
                    Fupload.SaveAs(sbpath);
                    exampleurl = savefilename;
                }

                LearnSite.Model.Mission mission = new LearnSite.Model.Mission();
                mission.Mcid      = Mcid;
                mission.Mtitle    = Texttitle.Text.Trim();
                mission.Msort     = maxSort;
                mission.Mupload   = true;
                mission.Mcategory = 2;//编程页面


                mission.Mexample   = exampleurl;//编程实例
                mission.Microworld = CheckMicoWorld.Checked;
                mission.Mpublish   = CheckPublish.Checked;
                mission.Mcontent   = HttpUtility.HtmlEncode(fckstr);
                mission.Mfiletype  = "sb2";
                mission.Mdate      = DateTime.Now;
                mission.Mhit       = 0;
                mission.Mgroup     = false;
                if (DDLMgid.SelectedValue != "")
                {
                    mission.Mgid = Int32.Parse(DDLMgid.SelectedValue);
                }
                else
                {
                    mission.Mgid = 0;
                }
                int mid = missionbll.Add(mission);
                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                lmodel.Lcid   = Mcid;
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Lsort  = maxSort;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 5;//页面类型为5 编程
                lmodel.Lxid   = mid;
                lbll.Add(lmodel);
                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString();
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "请填写标题或选择实例!";
        }
    }
예제 #5
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null)
            {
                string Mcidstr    = Request.QueryString["Mcid"].ToString();
                int    Mcid       = Int32.Parse(Mcidstr);
                string coursePath = LearnSite.Store.CourseStore.CoursePath(Mcidstr);
                if (CheckRemote.Checked)
                {
                    fckstr = LearnSite.Common.ImageDown.UploadRemote(fckstr, coursePath);
                }
                LearnSite.BLL.Mission   missionbll = new LearnSite.BLL.Mission();
                LearnSite.Model.Mission mission    = new LearnSite.Model.Mission();
                LearnSite.BLL.ListMenu  lbll       = new LearnSite.BLL.ListMenu();
                int maxSort = lbll.GetMaxLsort(Mcid) + 1;
                mission.Mcid   = Mcid;
                mission.Mtitle = Texttitle.Text.Trim();
                mission.Msort  = maxSort;
                bool uploadcan = CheckUpload.Checked;
                mission.Mupload = uploadcan;
                if (uploadcan)
                {
                    mission.Mcategory = 0;//有作业提交
                }
                else
                {
                    mission.Mcategory = 1;//无作业提交
                }
                mission.Mexample  = "";
                mission.Mpublish  = CheckPublish.Checked;
                mission.Mcontent  = HttpUtility.HtmlEncode(fckstr);
                mission.Mfiletype = DDLmfiletype.SelectedValue;
                mission.Mdate     = DateTime.Now;
                mission.Mhit      = 0;
                mission.Mgroup    = CheckGroup.Checked;
                if (DDLMgid.SelectedValue != "")
                {
                    mission.Mgid = Int32.Parse(DDLMgid.SelectedValue);
                }
                else
                {
                    mission.Mgid = 0;
                }
                int mid = missionbll.Add(mission);
                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                lmodel.Lcid   = Mcid;
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Lsort  = maxSort;
                lmodel.Ltitle = Texttitle.Text.Trim();
                if (uploadcan)
                {
                    lmodel.Ltype = 1;
                }
                else
                {
                    lmodel.Ltype = 6;//描述页面
                }
                lmodel.Lxid = mid;
                lbll.Add(lmodel);
                System.Threading.Thread.Sleep(500);
                //Labelmsg.Text = "添加学案活动成功";
                string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString();
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }