Ejemplo n.º 1
0
 protected void btnSaveHTML_Click(object sender, EventArgs e)
 {
     string CID = this.Request.QueryString["cid"].ToString();
     string IID = this.Request.QueryString["iid"].ToString();
     int courseid;
     int Itemid;
     if (int.TryParse(CID, out courseid) && int.TryParse(IID, out Itemid)) //check is number...
     {
         BaseHandler bh = new BaseHandler();
         List<CourseItemComment> objCourseItemComment = (List<CourseItemComment>)bh.GetCourseItemComment(courseid, Itemid);
         if (objCourseItemComment.Count > 0)
         {
             objCourseItemComment[0].HtmlText = hdHTML.Value;
             bh.UpdateCourseItemComment(objCourseItemComment[0]);
            labHtmlText.Text= objCourseItemComment[0].HtmlText  ;
         }
     }
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Request.QueryString["cid"] != null && !string.IsNullOrWhiteSpace(Request.QueryString["cid"])
                        && Request.QueryString["iid"] != null && !string.IsNullOrWhiteSpace(Request.QueryString["iid"]))
                    {
                        string CID = this.Request.QueryString["cid"].ToString();
                        string IID = this.Request.QueryString["iid"].ToString();
                        int courseid;
                        int Itemid;
                        if (int.TryParse(CID, out courseid) && int.TryParse(IID, out Itemid)) //check is number...
                        {
                            BaseHandler bh = new BaseHandler();
                            List<CourseItemComment> objCourseItemComment = (List<CourseItemComment>)bh.GetCourseItemComment(courseid, Itemid);
                            if (objCourseItemComment.Count > 0)
                            {
                                labHtmlText.Text = objCourseItemComment[0].HtmlText;
                            }
                        }

                    }
                    else
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "StartupScriptforTree",
                            "alert('Please Select Course');", true);
                    }

                    string editQS = Request.QueryString["edit"];
                    if (editQS != null && !string.IsNullOrWhiteSpace(editQS) && editQS.ToLower() == "true" )
                    {
                        btnEditHTML.Style.Add("display", "block");
                    }
                    else
                    {
                        btnEditHTML.Style.Add("display", "none");
                    }

                }
                catch (Exception exc) //Module failed to load
                {
                    Exceptions.ProcessModuleLoadException(this, exc);
                }
            }
        }