private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;
			// Add the CSS
			string cssfile = String.Format("{0}Modules/Shop/Images/Standard/shop.css",UrlHelper.GetApplicationPath());
			this.RegisterStylesheet("shopcss",cssfile);

			this._origProduct		= this._module.GetShopProductById(this._module.CurrentShopProductId);
			this._shopShop	= this._module.GetShopById(this._module.CurrentShopId);
			this._module.CurrentShopCategoryId	= this._shopShop.CategoryId;

            this.BindTopFooter();
            base.LocalizeControls();
            this.ltOrigProduct.Text = this._origProduct.Message;
			this.BindJS();
			this.BindEmoticon();

			if(!this.IsPostBack)
			{
				if(this._module.QuoteProduct == 1)
				{
					this.txtMessage.Text = "[quote]" + TextParser.HtmlToShopCode(this._origProduct.Message,this._module) + "[/quote]";
				}
			}
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;
			this.btnCancel.Attributes.Add("onClick", String.Format("document.location.href='AdminShop.aspx{0}'", base.GetBaseQueryString()));
			if (! this.IsPostBack)
			{
				this.lstCategories.Items.Add(new ListItem("none", "0"));
				IList categories = this._module.GetAllCategories();
				foreach (ShopCategory category in categories)
				{
					this.lstCategories.Items.Add(new ListItem(category.Name, category.Id.ToString()));
				}
			}

			if (Request.QueryString["ShopId"] != null)
			{
				int shopId = Int32.Parse(Request.QueryString["ShopId"]);
				if (shopId > 0)
				{
					this._shop = this._module.GetShopById(shopId);
					if (! this.IsPostBack)
					{
						BindShop();
					}
					this.btnDelete.Visible = true;
					this.btnDelete.Attributes.Add("onClick", "return confirm('Are you sure?');");
				}
			}
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
            try
            {
                base.Title = "Shop administration";
                this._module = base.Module as ShopModule;
                if (!this.IsPostBack)
                {
                    this.rptShopCategories.DataSource = this._module.GetAllCategories();
                    this.rptShopCategories.DataBind();

                    this.rptShoplist.DataSource = this._module.GetAllShops();
                    this.rptShoplist.DataBind();

                    
                    this.rptEmoticons.DataSource = this._module.GetAllEmoticons();
                    this.rptEmoticons.DataBind();

                    this.rptTags.DataSource = this._module.GetAllTags();
                    this.rptTags.DataBind();
                    
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error when loading shop module ", ex);
            }
		}
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                this._module = base.Module as ShopModule;
                // Add the CSS
                string cssfile = String.Format("{0}Modules/Shop/Images/Standard/shop.css", UrlHelper.GetApplicationPath());
                this.RegisterStylesheet("shopcss", cssfile);

                if (this.Page.User.Identity.IsAuthenticated)
                {
                    Cuyahoga.Core.Domain.User currentUser = Context.User.Identity as Cuyahoga.Core.Domain.User;
                }

                this.BindTopFooter();

                if (!this.Page.IsPostBack)
                {
                    this.BindAddress();
                }

                base.LocalizeControls();

            }
            catch (Exception ex)
            {
                throw new Exception("Unable to load the Shop module ", ex);
            }
        }
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;
			// Add the CSS
			string cssfile = String.Format("{0}Modules/Shop/Images/Standard/shop.css",UrlHelper.GetApplicationPath());
			this.RegisterStylesheet("shopcss",cssfile);
            this.BindTopFooter();
            this.LocalizeControls();
        }
		private void BindTopFooter()
		{
			ShopTop tShopTop;
			ShopFooter tShopFooter;

			this._module = this.Module as ShopModule;
			tShopTop = (ShopTop)this.LoadControl("~/Modules/Shop/ShopTop.ascx");
			tShopTop.Module = this._module;
			this.phShopTop.Controls.Add(tShopTop);

			tShopFooter = (ShopFooter)this.LoadControl("~/Modules/Shop/ShopFooter.ascx");
			tShopFooter.Module	= this._module;
			this.phShopFooter.Controls.Add(tShopFooter);
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;

			// Add the CSS
			string cssfile = String.Format("{0}Modules/Shop/Images/Standard/shop.css",UrlHelper.GetApplicationPath());
			this.RegisterStylesheet("shopcss",cssfile);

			this._shopShop	= this._module.GetShopById(this._module.CurrentShopId);
			this._module.CurrentShopCategoryId	= this._shopShop.CategoryId;

            this.BindTopFooter();
            base.LocalizeControls();
            this.BindJS();
			this.BindEmoticon();
		}
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                this._module = base.Module as ShopModule;
                if (Request.QueryString["ImageId"] != null)
                {

                    MemoryStream ms = new MemoryStream(this._module.GetShopImageById(int.Parse(Request.QueryString["ImageId"])).Data);

                    Bitmap bmpImage = new Bitmap(ms);
                    byte[] bufferImage;

                    int x = bmpImage.Width;
                    int y = bmpImage.Height;

                    if (Request.QueryString["ImageOutputWidth"] != null)
                    {
                        x = int.Parse(Request.QueryString["ImageOutputWidth"]);
                        y = (x * bmpImage.Height) / bmpImage.Width;
                    }

                    if (x < bmpImage.Width || y < bmpImage.Height)
                    {
                        Size scale = new Size(x, y);
                        bmpImage = new Bitmap(bmpImage, scale);
                    }

                    ms = new MemoryStream();
                    bmpImage.Save(ms, ImageFormat.Jpeg);

                    bufferImage = new byte[(int)ms.Length];

                    ms.Position = 0;
                    for (int i = 0; i < (int)ms.Length; i++)
                    {
                        bufferImage[i] = (byte)ms.ReadByte();
                    }
                 
                    this.Response.BinaryWrite(bufferImage);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;
			// Add the CSS
			string cssfile = String.Format("{0}Modules/Shop/Images/Standard/shop.css",UrlHelper.GetApplicationPath());
			this.RegisterStylesheet("shopcss",cssfile);

			this._shopShop	= this._module.GetShopById(this._module.CurrentShopId);
			this._module.CurrentShopCategoryId = this._shopShop.CategoryId;

            if (this.Page.User.Identity.IsAuthenticated)
            {
                Cuyahoga.Core.Domain.User currentUser = Context.User.Identity as Cuyahoga.Core.Domain.User;
                this._module.SetCurrentOrder(currentUser);
            }

			this.BindTopFooter();
			if(this._shopShop.AllowGuestPublish == 1 || this.Page.User.Identity.IsAuthenticated)
			{
                this.HyperLinkEdit.Visible = true;
				this.hplReply.Visible = true;
                this.lbtnBuy.Visible = true;
            }
			else
			{
                this.HyperLinkEdit.Visible = false;
				this.hplReply.Visible = false;
                this.lbtnBuy.Visible = false;
            }


			if(!this.IsPostBack)
			{
                this.LocalizeControls();
                this.BindLinks();
				this.BindShopProduct();
                this.BindShopProductImages();
                this.BindShopProductComments();
            }
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;

			// Add the CSS
			string cssfile = String.Format("{0}Modules/Shop/Images/Standard/shop.css",UrlHelper.GetApplicationPath());
			this.RegisterStylesheet("shopcss",cssfile);

			this._shopShop	= this._module.GetShopById(this._module.CurrentShopId);
			this._module.CurrentShopCategoryId	= this._shopShop.CategoryId;

            if (!IsPostBack)
            {
                ShopProduct product = this._module.GetShopProductById(this._module.CurrentShopProductId);
                if (product != null)
                {
                    this.txtMessage.Text = product.Message;
                    this.txtPrice.Text = product.Price.ToString();
                    this.txtSubject.Text = product.Title;
                    this.btnDelete.Visible = true;

                    if (product.Images.Count > 0)
                    {
                        MemoryStream ms = new MemoryStream();
                        ShopImage image = (ShopImage)product.Images[0];

                        if (image.Data != null)
                        {
                            this.ImageControl1.Bitmap = Utils.Utils.ImageResize(image.Data, this._module.ImageWidth); ;
                            this.ImageControl1.Visible = true;
                        }
                    }
                }
                this.BindTopFooter();
                base.LocalizeControls();
                this.BindJS();
                this.BindEmoticon();
            }
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = base.Module as ShopModule;
			this.btnCancel.Attributes.Add("onClick", String.Format("document.location.href='AdminShop.aspx{0}'", base.GetBaseQueryString()));
			if (! this.IsPostBack)
			{
			}

			if (Request.QueryString["TagId"] != null)
			{
				int tagId = Int32.Parse(Request.QueryString["TagId"]);
				if (tagId > 0)
				{
					this._shoptag = this._module.GetTagById(tagId);
					if (! this.IsPostBack)
					{
						BindTag();
					}
					this.btnDelete.Visible = true;
					this.btnDelete.Attributes.Add("onClick", "return confirm('Are you sure?');");
				}
			}
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			this._module = this.Module as ShopModule;
			this.ShopBreadCrumb();
			this.Translate();
		}