Exemplo n.º 1
0
 protected void grid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         //var main = false;
         //var photo = PhotoService.GetProductPhoto(Convert.ToInt32(e.CommandArgument));
         //if (photo != null)
         //{
         //    main = PhotoService.GetProductPhoto(Convert.ToInt32(e.CommandArgument)).Main;
         //}
         PhotoService.DeleteProductPhoto(Convert.ToInt32(e.CommandArgument));
         //if (main)
         OnMainPhotoUpdate(EventArgs.Empty);
     }
 }
Exemplo n.º 2
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 PhotoService.DeleteProductPhoto(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("PhotoID as ID");
             foreach (var id in itemsIds.Where(phId => !_selectionFilter.Values.Contains(phId.ToString())))
             {
                 PhotoService.DeleteProductPhoto(id);
             }
         }
     }
 }