Exemplo n.º 1
0
        protected void imbAdd_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                SQLHandler sq = new SQLHandler();

                HTMLTextDataContext db = new HTMLTextDataContext(SystemSetting.SageFrameConnectionString);
                if (Session["EditCommentID"] != null)
                {
                    List <KeyValuePair <string, object> > ParaMeterCollection = new List <KeyValuePair <string, object> >();
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@HTMLCommentID", Session["EditCommentID"]));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@Comment", txtComment.Text));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@IsApproved", chkApprove.Checked));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@IsActive", chkIsActive.Checked));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@IsModified", true));

                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@UpdatedOn", DateTime.Now));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@PortalID", GetPortalID));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@UpdatedBy", GetUsername));
                    sq.ExecuteNonQuery("dbo.sp_HtmlCommentUpdate", ParaMeterCollection);

                    ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("HTML", "CommentIsUpdatedSuccessfully"), "", SageMessageType.Success);
                }
                else
                {
                    List <KeyValuePair <string, object> > ParaMeterCollection = new List <KeyValuePair <string, object> >();
                    //ParaMeterCollection.Add(new KeyValuePair<string, object>("@HTMLCommentID", _newHTMLCommentID));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@HTMLTextID", hdfHTMLTextID.Value));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@Comment", txtComment.Text));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@IsApproved", chkApprove.Checked));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@IsActive", chkIsActive.Checked));

                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@AddedOn", DateTime.Now));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@PortalID", GetPortalID));
                    ParaMeterCollection.Add(new KeyValuePair <string, object>("@AddedBy", GetUsername));
                    sq.ExecuteNonQuery("dbo.sp_HtmlCommentAdd", ParaMeterCollection, "@HTMLCommentID");

                    if (chkApprove.Checked && chkIsActive.Checked)
                    {
                        ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("HTML", "CommentIsAddedSuccessfully"), "", SageMessageType.Success);
                    }
                    else
                    {
                        ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("HTML", "CommentWillBeAddedAfterApproved"), "", SageMessageType.Alert);
                    }
                }

                HideAll();
                BindComment();

                divViewWrapper.Visible = true;
                divViewComment.Visible = true;

                ClearComment();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
Exemplo n.º 2
0
 private void BindEditor()
 {
     try
     {
         HTMLTextDataContext db = new HTMLTextDataContext(SystemSetting.SageFrameConnectionString);
         var LINQContent        = db.sp_HtmlTextGetByPortalAndUserModule(GetPortalID, Int32.Parse(hdnUserModuleID.Value), GetCurrentCultureName).SingleOrDefault();
         if (LINQContent != null)
         {
             txtBody.Value               = LINQContent.Content;
             chkPublish.Checked          = bool.Parse(LINQContent.IsActive.ToString());
             chkAllowComment.Checked     = bool.Parse(LINQContent.IsAllowedToComment.ToString());
             ViewState["EditHtmlTextID"] = LINQContent.HtmlTextID;
             divEditWrapper.Visible      = true;
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Exemplo n.º 3
0
        protected void imbAdd_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                SQLHandler sq = new SQLHandler();

                HTMLTextDataContext db = new HTMLTextDataContext(SystemSetting.SageFrameConnectionString);
                if (Session["EditCommentID"] != null)
                {
                    List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@HTMLCommentID", Session["EditCommentID"]));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@Comment", txtComment.Text));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsApproved", chkApprove.Checked));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsActive", chkIsActive.Checked));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsModified", true));

                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@UpdatedOn", DateTime.Now));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@PortalID", GetPortalID));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@UpdatedBy", GetUsername));
                    sq.ExecuteNonQuery("dbo.sp_HtmlCommentUpdate", ParaMeterCollection);

                    ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("HTML", "CommentIsUpdatedSuccessfully"), "", SageMessageType.Success);
                }
                else
                {
                    List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
                    //ParaMeterCollection.Add(new KeyValuePair<string, object>("@HTMLCommentID", _newHTMLCommentID));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@HTMLTextID", hdfHTMLTextID.Value));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@Comment", txtComment.Text));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsApproved", chkApprove.Checked));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsActive", chkIsActive.Checked));

                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@AddedOn", DateTime.Now));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@PortalID", GetPortalID));
                    ParaMeterCollection.Add(new KeyValuePair<string, object>("@AddedBy", GetUsername));
                    sq.ExecuteNonQuery("dbo.sp_HtmlCommentAdd", ParaMeterCollection, "@HTMLCommentID");

                    if (chkApprove.Checked && chkIsActive.Checked)
                    {
                        ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("HTML", "CommentIsAddedSuccessfully"), "", SageMessageType.Success);
                    }
                    else
                    {
                        ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("HTML", "CommentWillBeAddedAfterApproved"), "", SageMessageType.Alert);
                    }
                }

                HideAll();
                BindComment();

                divViewWrapper.Visible = true;
                divViewComment.Visible = true;

                ClearComment();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
Exemplo n.º 4
0
 private void BindEditor()
 {
     try
     {
         HTMLTextDataContext db = new HTMLTextDataContext(SystemSetting.SageFrameConnectionString);
         var LINQContent = db.sp_HtmlTextGetByPortalAndUserModule(GetPortalID, Int32.Parse(hdnUserModuleID.Value), GetCurrentCultureName).SingleOrDefault();
          if (LINQContent != null)
          {
              txtBody.Value = LINQContent.Content;
              chkPublish.Checked = bool.Parse(LINQContent.IsActive.ToString());
              chkAllowComment.Checked = bool.Parse(LINQContent.IsAllowedToComment.ToString());
              ViewState["EditHtmlTextID"] = LINQContent.HtmlTextID;
              divEditWrapper.Visible = true;     
          }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }