protected void ErrorItemCommand(object o, GridCommandEventArgs e)
 {
     if (e.CommandName == RadGrid.DeleteCommandName)
     {
         var template = new CMData.SubscriberRepository().GetByEmail((e.Item.FindControl("lblEmail") as IdeaSeed.Web.UI.Label).Text);
         template.IsActive = false;
         new CMData.SubscriberRepository().Save(template);
         var err = new CMData.CampaignEmailErrorRepository().GetByID(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"]), false);
         err.Removed = true;
         new CMData.CampaignEmailErrorRepository().Save(err);
         tsCampaignDetails.SelectedIndex = CurrentTab;
         LoadDetailsByTab(tsCampaignDetails.SelectedTab.Value, true);
     }
 }
 protected void ApplyClicked(object o, EventArgs e)
 {
     foreach (GridDataItem row in rgErrors.MasterTableView.Items)
     {
         var cb = row.FindControl("cbSelectRow") as IdeaSeed.Web.UI.CheckBox;
         if (cb.Checked)
         {
             var subscriber = new CMData.SubscriberRepository().GetByEmail(cb.Attributes["email"]);
             subscriber.IsActive = false;
             new CMData.SubscriberRepository().Save(subscriber);
             var err = new CMData.CampaignEmailErrorRepository().GetByID(Convert.ToInt32(cb.Attributes["itemid"]), false);
             err.Removed = true;
             new CMData.CampaignEmailErrorRepository().Save(err);
         }
     }
     tsCampaignDetails.SelectedIndex = CurrentTab;
     LoadDetailsByTab(tsCampaignDetails.SelectedTab.Value, true);
 }