/// <summary> /// Adds the media to album. /// </summary> /// <param name="batch">The batch.</param> /// <param name="mediaId">The media id.</param> private void AddMediaToAlbum(UploadBatch batch, int mediaId) { if(!string.IsNullOrEmpty(batch.Albums)) { string[] ids = batch.Albums.Split(','); foreach (string id in ids.Where(id => !string.IsNullOrEmpty(id))) { _albumRepository.AddPhotoToAlbum(Convert.ToInt32(id), mediaId); } } }
/// <summary> /// Saves the location. /// </summary> /// <param name="batch">The batch.</param> /// <param name="userId">The user id.</param> private void SaveLocation(UploadBatch batch, int userId) { if(!string.IsNullOrEmpty(batch.LocationName) && batch.Latitude.HasValue && batch.Longitude.HasValue && batch.Zoom.HasValue && !string.IsNullOrEmpty(batch.MapTypeId) ) { Location location = new Location { LocationName = batch.LocationName, Latitude = batch.Latitude.GetValueOrDefault(), Longitude = batch.Longitude.GetValueOrDefault(), MapTypeId = batch.MapTypeId, Zoom = batch.Zoom.GetValueOrDefault(), UserId = userId }; _locationRepository.Save(location); } }
/// <summary> /// Inserts the batch. /// </summary> /// <param name="batch">The batch.</param> public void InsertBatch(UploadBatch batch) { database.NonQuery("UploadBatch_Insert", batch); }