09-May-2018 An update on progress...
11-Apr-2018
10-Apr-2018 TODO List:
23-Mar-2018 Win Forms - following on from my review of options to update grids, the 'other' option is to only process any changes once the user has finished with the grid.
19-Mar-2018 Win Forms - Bad Coding Smell (14/3). The use of a timer to delete a cancelled add-row...
else if (result == DialogResult.No)
{
RowToDelete = e.RowIndex;
ViewModel = null;
timerDVG.Start();
}
private void timerDVG_Tick(object sender, EventArgs e)
{
if(RowToDelete > -1)
{
dataGridView_Artist.Rows.RemoveAt(RowToDelete);
RowToDelete = -1;
timerDVG.Stop();
}
}
else if (result == DialogResult.No)
{
RowToDelete = e.RowIndex;
ViewModel = null;
this.BeginInvoke(new MethodInvoker(EndEdit_DeleteRow));
}
void EndEdit_DeleteRow()
{
if (RowToDelete > -1)
{
dataGridView_Media.Rows.RemoveAt(RowToDelete);
RowToDelete = -1;
}
}
16-Mar-2018 Win Forms - ditched the MDI. Media and Artist screens tested working for on-screen grid editing. But is it really worth it?
14-Mar-2018 ...well, no change in 18 years - still the same rubbish grid it always was!!
13-Mar-2018 MDI and Artist screens added using unbound DataViewGrid (DVG). Populated with data. Now for the in-line editing...
12-Mar-2018 Starting on adding a Windows Forms (that's a Windows desktop application!) user interface on top of the stack.
01-Mar-2018 Added ADO alongside EF in database access layer
21-Feb-2018 - Restructuring
20-Feb-2018 (8am) - All Working :-)
media = db.MediaLibItems.Include("MediaFormat").Include("MediaType").Include("MediaArtist").Include("MediaLabel").Single(m => m.MediaId == mediaid);
mediaToDelete.media = db.MediaLibItems.Single(m => m.MediaId == mediaid);
// Now get the child table text values from the ids
int? formatid = mediaToDelete.media.FormatId;
int? labelid = mediaToDelete.media.LabelId;
int? typeid = mediaToDelete.media.MediaTypeId;
int? artistid = mediaToDelete.media.ArtistId;
mediaToDelete.FormatName = formatid == null ? "" : db.MediaLibFormat.SingleOrDefault(m => m.FormatId == formatid).FormatName.ToString();
mediaToDelete.LabelName = labelid == null ? "" : db.MediaLibLabel.SingleOrDefault(m => m.LabelId == labelid).LabelName.ToString();
mediaToDelete.TypeName = typeid == null ? "" : db.MediaLibType.SingleOrDefault(m => m.MediaTypeId == typeid).TypeName.ToString();
mediaToDelete.ArtistName = artistid == null ? "" : db.MediaLibArtist.SingleOrDefault(m => m.ArtistId == artistid).ArtistName.ToString();
19-Feb-2018 - All Gone Wrong!!!
21-Jan-2018 - Some Real Data.
19-Jan-2018 - More Maintenance Screens.
10-Jan-2018 - Time to get it sorted!
To help, this is the the basic structure of the database:
public ActionResult Index()
{
MediaPartialList model = new MediaPartialList();
using (var db = new MediaDBContext())
{
List media = db.MediaLibItems.ToList(); // this is all the data
List media = db.MediaLibItems.Include("MediaFormat").Include("MediaType").Include("MediaArtist").Include("MediaLabel").ToList();
model.MediaList = media;
var formats = GetMediaFormats();
var types = GetMediaTypes();
var artists = GetMediaArtists();
var labels = GetMediaLabels();
model.FormatList = formats.ToList();
model.TypeList = types.ToList();
model.ArtistList = artists.ToList();
model.LabelList = labels.ToList();
}
return View(model);
}
public ActionResult Index()
{
MediaPartialList model = new MediaPartialList();
using (var db = new MediaDBContext())
{
List media = db.MediaLibItems.Include("MediaFormat").Include("MediaType").Include("MediaArtist").Include("MediaLabel").ToList();
model.MediaList = media;
}
return View(model);
}
09-Jan-2018 - Added a couple of maintenance screens to Media Library
After much searching and testing plausible solutions, the one that worked fell in line with the data required to populate the Combos, so no extra hit on the database, but did not feel like the right solution."