Exemplo n.º 1
0
 protected void grid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeletePage")
     {
         StaticPageService.DeleteStaticPage(SQLDataHelper.GetInt(e.CommandArgument));
         _needReloadTree = true;
         //Response.Redirect("StaticPages.aspx",true );
     }
 }
Exemplo n.º 2
0
 protected void tree_TreeNodeCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName.StartsWith("DeleteStaticPage"))
     {
         int statpageId = -1;
         if (e.CommandName.Contains("#"))
             statpageId = Convert.ToInt32(e.CommandName.Substring(e.CommandName.IndexOf("#") + 1));
         if (statpageId == -1) return;
         if (statpageId != 0)
             StaticPageService.DeleteStaticPage(statpageId);
         Response.Redirect(Request.RawUrl);
     }
 }
Exemplo n.º 3
0
 protected void tree_TreeNodeCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName.StartsWith("DeleteStaticPage"))
     {
         int statpageId = -1;
         if (e.CommandName.Contains("#"))
         {
             statpageId = SQLDataHelper.GetInt(e.CommandName.Substring(e.CommandName.IndexOf("#") + 1));
         }
         if (statpageId == -1)
         {
             return;
         }
         if (statpageId != 0)
         {
             StaticPageService.DeleteStaticPage(statpageId);
         }
         Response.Redirect(Request.RawUrl);
     }
 }
Exemplo n.º 4
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 StaticPageService.DeleteStaticPage(SQLDataHelper.GetInt(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("StaticPageID as ID");
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 StaticPageService.DeleteStaticPage(id);
             }
         }
     }
 }