Exemplo n.º 1
0
 protected void AlphabetRepeater_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
 {
     if ((e.CommandArgument.ToString().Length == 1))
     {
         WebpagesDs.SelectParameters["searchPhrase"].DefaultValue = (e.CommandArgument.ToString() + "*");
     }
     else
     {
         WebpagesDs.SelectParameters["searchPhrase"].DefaultValue = String.Empty;
     }
     WebpagesGrid.DataBind();
 }
Exemplo n.º 2
0
        protected void WebpagesGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int webPageId = AlwaysConvert.ToInt(e.CommandArgument);

            if (e.CommandName.ToLower() == "dodelete")
            {
                WebpageDataSource.Delete(webPageId);
                WebpagesGrid.DataBind();
            }

            else if (e.CommandName.ToLower() == "docopy")
            {
                Webpage page = Webpage.Copy(webPageId);
                page.Name = string.Format("Copy of {0}", page.Name);
                page.Save();
                WebpagesGrid.DataBind();
            }
        }
Exemplo n.º 3
0
        protected void WebpagesGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int     webPageId = AlwaysConvert.ToInt(e.CommandArgument);
            Webpage webpage   = WebpageDataSource.Load(webPageId);

            if (e.CommandName.ToLower() == "dodelete")
            {
                WebpageDataSource.Delete(webPageId);
                WebpagesGrid.DataBind();
            }

            else if (e.CommandName.ToLower() == "docopy")
            {
                Webpage page = Webpage.Copy(webPageId);
                page.Name = string.Format("Copy of {0}", page.Name);
                page.Save();
                WebpagesGrid.DataBind();
            }

            else if (e.CommandName.ToLower() == "do_pub")
            {
                switch (webpage.Visibility)
                {
                case CatalogVisibility.Public:
                    webpage.Visibility = CatalogVisibility.Hidden;
                    break;

                case CatalogVisibility.Hidden:
                    webpage.Visibility = CatalogVisibility.Private;
                    break;

                default:
                    webpage.Visibility = CatalogVisibility.Public;
                    break;
                }
                webpage.Save();

                WebpagesGrid.DataBind();
            }
        }
Exemplo n.º 4
0
 protected void UpdateDefaultsButton_Click(Object sender, EventArgs e)
 {
     _Settings.ProductWebpageId = AlwaysConvert.ToInt(ProductsDefault.SelectedValue);
     _Settings.Save();
     WebpagesGrid.DataBind();
 }