Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["PID"] != null && !string.IsNullOrEmpty(Request.QueryString["PID"].ToString()))
         {
             int id = Convert.ToInt32(Request.QueryString["PID"].ToString());
             SitePages page = new SitePages();
             page.LoadByPrimaryKey(id);
             if (page.RowCount > 0)
             {
                 uiLabelTitle.Text = page.PageTitleEng;
                 uiLiteralContent.Text = Server.HtmlDecode(page.PageTextEng);
             }
             else
             {
                 Response.Redirect("~/default.aspx");
             }
         }
         else
         {
             Response.Redirect("~/default.aspx");
         }
     }
 }
Ejemplo n.º 2
0
 protected void uiLinkButtonOK_Click(object sender, EventArgs e)
 {
     SitePages objData = new SitePages();
     objData = CurrentPage;
     objData.PageTitleEng = uiTextBoxEnName.Text;
     objData.PageTitleAr = uiTextBoxArName.Text;
     objData.PageTextEng = Server.HtmlEncode(uiFCKeditorEnContent.Value);
     objData.PageTextAr = Server.HtmlEncode(uiFCKeditorArContent.Value);
     objData.Save();
     CurrentPage = null;
     uiPanelAllCats.Visible = true;
     uiPanelEditCat.Visible = false;
     BindData();
 }
Ejemplo n.º 3
0
 protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditPage")
     {
         SitePages objData = new SitePages();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         CurrentPage = objData;
         uiTextBoxArName.Text = objData.PageTitleAr;
         uiTextBoxEnName.Text = objData.PageTitleEng;
         uiFCKeditorArContent.Value = Server.HtmlDecode(objData.PageTextAr);
         uiFCKeditorEnContent.Value = Server.HtmlDecode(objData.PageTextEng);
         uiPanelAllCats.Visible = false;
         uiPanelEditCat.Visible = true;
     }
 }
Ejemplo n.º 4
0
 private void BindData()
 {
     SitePages objData = new SitePages();
     objData.LoadAll();
     uiGridViewPages.DataSource = objData.DefaultView;
     uiGridViewPages.DataBind();
 }
Ejemplo n.º 5
0
 protected void uiLinkButtonCancel_Click(object sender, EventArgs e)
 {
     CurrentPage = null;
     uiPanelAllCats.Visible = true;
     uiPanelEditCat.Visible = false;
 }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CurrentUser"] != null)
            {
                lbtnLogin.Visible = false;
                lbtnLogout.Visible = true;
                lbtnProfile.Visible = true;

            }
            else
            {
                lbtnLogin.Visible = true;
                lbtnLogout.Visible = false;
                lbtnProfile.Visible = false;

            }

            SitePages page = new SitePages();
            page.LoadByPrimaryKey(1);
            string inputHTML = Server.HtmlDecode(page.PageTextAr);
            string noHTML = Regex.Replace(inputHTML, @"<[^>]+>|&nbsp;", "").Trim();
            string noHTMLNormalised = Regex.Replace(noHTML, @"\s{2,}", " ");
            if (noHTMLNormalised.Length > 250)
                uiLiteralAbout.Text = noHTMLNormalised.Substring(0, 250) + " ...";
            else
                uiLiteralAbout.Text = noHTMLNormalised;
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CurrentUser"] != null)
            {
                lbtnLogin.Visible = false;
                lbtnLogout.Visible = true;
                lbtnProfile.Visible = true;
                UserInfo user = (UserInfo)Session["CurrentUser"];
                UserFavorites fav = new UserFavorites();
                fav.GetFavouritesByUserID(user.UserID);
                uiLabelFavCount.Text = fav.RowCount.ToString();

            }
            else
            {
                lbtnLogin.Visible = true;
                lbtnLogout.Visible = false;
                lbtnProfile.Visible = false;
                uiLabelFavCount.Text = "0";

            }

            UpdateCart();

            SitePages page = new SitePages();
            page.LoadByPrimaryKey(1);
            string inputHTML = Server.HtmlDecode(page.PageTextEng);
            string noHTML = Regex.Replace(inputHTML, @"<[^>]+>|&nbsp;", "").Trim();
            string noHTMLNormalised = Regex.Replace(noHTML, @"\s{2,}", " ");
            if (noHTMLNormalised.Length > 250)
                uiLiteralAbout.Text = noHTMLNormalised.Substring(0, 250) + " ...";
            else
                uiLiteralAbout.Text = noHTMLNormalised;
        }