コード例 #1
0
 protected void Btnedit_Click(object sender, EventArgs e)
 {
     string fckstr = FCKeditor1.Value;
     if (Texttitle.Text != "" && fckstr != "")
     {
         if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null)
         {
             string serverUrl = LearnSite.Common.WordProcess.ServerUrl();
             fckstr = fckstr.Replace(serverUrl, "");
             string Mcid = Request.QueryString["Mcid"].ToString();
             string Mid = Request.QueryString["Mid"].ToString();
             LearnSite.Model.Mission mission = new LearnSite.Model.Mission();
             mission.Mid = Int32.Parse(Mid);
             mission.Mtitle = Texttitle.Text.Trim();
             mission.Msort = Int32.Parse(DDLsort.SelectedValue);
             mission.Mupload = CheckUpload.Checked;
             mission.Mpublish = CheckPublish.Checked;
             mission.Mcontent = HttpUtility.HtmlEncode(fckstr);
             mission.Mfiletype = DDLmfiletype.SelectedValue;
             mission.Mdate = DateTime.Now;
             mission.Mhit = 0;
             LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission();
             missionbll.Update(mission);
             Texttitle.Text = "";
             FCKeditor1.Value = "";
             System.Threading.Thread.Sleep(1000);
             Labelmsg.Text = "添加活动成功";
             string url = "~/Teacher/missionshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid;
             Response.Redirect(url, false);
         }
         else
         {
             Labelmsg.Text = "取不到活动编号Mid!";
         }
     }
     else
     {
         Labelmsg.Text = "内容及标题不能为空!";
     }
 }
コード例 #2
0
    protected void Btnedit_Click(object sender, EventArgs e)
    {
        string fckstr = mcontent.InnerText;

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null && Request.QueryString["Lid"] != null)
            {
                string Mcid = Request.QueryString["Mcid"].ToString();
                string Mid  = Request.QueryString["Mid"].ToString();
                string Lid  = Request.QueryString["Lid"].ToString();

                string coursePath = LearnSite.Store.CourseStore.CoursePath(Mcid);
                if (CheckRemote.Checked)
                {
                    fckstr = LearnSite.Common.ImageDown.UploadRemote(fckstr, coursePath);
                }

                LearnSite.Model.Mission mission = new LearnSite.Model.Mission();
                mission.Mid    = Int32.Parse(Mid);
                mission.Mtitle = Texttitle.Text.Trim();
                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;
                }
                LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission();
                missionbll.Update(mission);

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();

                lmodel.Lid = Int32.Parse(Lid);
                if (uploadcan)
                {
                    lmodel.Ltype = 1;
                }
                else
                {
                    lmodel.Ltype = 6;//描述页面
                }
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lbll.UpdateMenuMission(lmodel);//专用活动分类更新

                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/missionshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid + "&Lid=" + Lid;
                Response.Redirect(url, false);
            }
            else
            {
                Labelmsg.Text = "取不到活动编号Mid!";
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
コード例 #3
0
    protected void Btnedit_Click(object sender, EventArgs e)
    {
        string fckstr = mcontent.InnerText;

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null)
            {
                string Mcid    = Request.QueryString["Mcid"].ToString();
                string Mid     = Request.QueryString["Mid"].ToString();
                string Example = HlExample.NavigateUrl;
                if (Fupload.HasFile)
                {
                    string savePath      = LearnSite.Store.CourseStore.GetSaveUrl("Course", Mcid);
                    string sbfilename    = Fupload.FileName;
                    string shortFileName = Path.GetFileName(sbfilename);
                    string savefilename  = savePath + shortFileName;
                    string sbpath        = this.Server.MapPath(savefilename);
                    Fupload.SaveAs(sbpath);
                    Example = savefilename;
                }
                LearnSite.Model.Mission mission = new LearnSite.Model.Mission();
                mission.Mid        = Int32.Parse(Mid);
                mission.Mtitle     = Texttitle.Text.Trim();
                mission.Mupload    = true;
                mission.Mcategory  = 2;       //编程页面
                mission.Mexample   = Example; //编程实例
                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;
                }
                LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission();
                missionbll.Update(mission);

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();

                lmodel.Lcid   = Int32.Parse(Mcid);
                lmodel.Lxid   = Int32.Parse(Mid);
                lmodel.Ltype  = 5;//页面类型为5 编程
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lbll.UpdateMenuThree(lmodel);
                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/programshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid;
                Response.Redirect(url, false);
            }
            else
            {
                Labelmsg.Text = "取不到主题编号Mid!";
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }