public bool UpdateData(string data) { if (CurrentlySelectedCategory != null) { ImageStackCategory imageStack = new ImageStackCategory(); imageStack.ImageStackName = data; imageStack.ParentCategoryID = CurrentlySelectedCategory.ID; imageStack.ParentCategoryName = CurrentlySelectedCategory.CategoryName; int success = new DatabaseContext <ImageStackCategory>().Insert(imageStack); TableItems = new DatabaseContext <ImageStackCategory>().GetQuery("SELECT * FROM ImageStackCategory WHERE ParentCategoryID = ?", CurrentlySelectedCategory.ID.ToString()); return(true); } new UIAlertView("Select a Category", null, null, "Ok", null).Show(); return(false); }
public void ImageStackToCollectionView(ImageStackCategory imageStackSelected) { /* * Update the CollectionView (3rd View) based on the image Stack Selected * Images from the imagestackimages table that haev image stack id */ SelectedImageStack = imageStackSelected; imageStackSplitViewController.setImageStackName(imageStackSelected); imageStackSplitViewController.updateImageStackNameLabel(imageStackSelected.ImageStackName); List <ImageStackImages> imagesFromStack = new DatabaseContext <ImageStackImages>().GetQuery("SELECT * FROM ImageStackImages WHERE ParentImageStackID = ? Order By ImageStackIndex", imageStackSelected.ID.ToString()); //send list of images to the collection view /*Create a new Class for the collection view? */ collectionViewController.UpdateImages(imagesFromStack); /* * Update the Button Selection in the collectionView */ switch (imageStackSelected.RandomizeImageStack) { case false: imageStackSplitViewController.returnCollectionViewStackInOrderButton().SelectedSegment = 1; break; case true: imageStackSplitViewController.returnCollectionViewStackInOrderButton().SelectedSegment = 0; break; default: /* * No Value Stored for this image stack. * Update the DB to account for this. */ if (SelectedImageStack != null) { SelectedImageStack.RandomizeImageStack = false; var result = new DatabaseContext <ImageStackCategory>().Update(SelectedImageStack); } imageStackSplitViewController.returnCollectionViewStackInOrderButton().SelectedSegment = 0; break; } }
public void setImageStackName(ImageStackCategory isc) { imageStackRow = isc; }
public void SetSelectedImageStack(ImageStackCategory stackSelected) { SelectedImageStack = stackSelected; }