protected void deleteEventButton_Click(object sender, EventArgs e) { foreach (string id in this.dataGrid.SelectedKeys) { AMSDeleteEntityExecutor <string, AMSEvent> executor = new AMSDeleteEntityExecutor <string, AMSEvent>( id, key => AMSEventSqlAdapter.Instance.DeleteByID(key), AMSOperationType.DeleteEvent); executor.Execute(); } this.InnerRefreshList(); }
protected void deleteEventButton_Click(object sender, EventArgs e) { foreach (string id in this.dataGrid.SelectedKeys) { AMSDeleteEntityExecutor<string, AMSEvent> executor = new AMSDeleteEntityExecutor<string, AMSEvent>( id, key => AMSEventSqlAdapter.Instance.DeleteByID(key), AMSOperationType.DeleteEvent); executor.Execute(); } this.InnerRefreshList(); }
public void DeleteEventExecutor() { AMSEventSqlAdapter.Instance.ClearAll(); AMSChannel channel = DataHelper.PrepareChannelData(); AMSEvent eventData = DataHelper.PrepareEventData(channel.ID); AMSEditEntityExecutor <AMSEvent> executor = new AMSEditEntityExecutor <AMSEvent>(eventData, data => AMSEventSqlAdapter.Instance.Update(data), AMSOperationType.EditEvent); executor.Execute(); AMSEvent eventLoaded = AMSEventSqlAdapter.Instance.LoadByChannelID(channel.ID).SingleOrDefault(); Assert.IsNotNull(eventLoaded); AMSDeleteEntityExecutor <string, AMSEvent> deleteExecutor = new AMSDeleteEntityExecutor <string, AMSEvent>(eventData.ID, key => AMSEventSqlAdapter.Instance.Delete(builder => builder.AppendItem("ID", key)), AMSOperationType.DeleteEvent); deleteExecutor.Execute(); Assert.IsFalse(AMSEventSqlAdapter.Instance.Exists(builder => builder.AppendItem("ID", eventData.ID))); }
public void DeleteEventExecutor() { AMSEventSqlAdapter.Instance.ClearAll(); AMSChannel channel = DataHelper.PrepareChannelData(); AMSEvent eventData = DataHelper.PrepareEventData(channel.ID); AMSEditEntityExecutor<AMSEvent> executor = new AMSEditEntityExecutor<AMSEvent>(eventData, data => AMSEventSqlAdapter.Instance.Update(data), AMSOperationType.EditEvent); executor.Execute(); AMSEvent eventLoaded = AMSEventSqlAdapter.Instance.LoadByChannelID(channel.ID).SingleOrDefault(); Assert.IsNotNull(eventLoaded); AMSDeleteEntityExecutor<string, AMSEvent> deleteExecutor = new AMSDeleteEntityExecutor<string, AMSEvent>(eventData.ID, key => AMSEventSqlAdapter.Instance.Delete(builder => builder.AppendItem("ID", key)), AMSOperationType.DeleteEvent); deleteExecutor.Execute(); Assert.IsFalse(AMSEventSqlAdapter.Instance.Exists(builder => builder.AppendItem("ID", eventData.ID))); }