Example #1
0
 /// <summary>
 /// Deletes the photo
 /// </summary>
 /// <param name='photo'>
 /// Photo
 /// </param>
 public void DeleteUser(Photo photo)
 {
     session.Delete<Photo>(photo);
 }
Example #2
0
 /// <summary>
 /// Creates new record in photo table or updates existing one
 /// </summary>
 /// <param name='photo'>
 /// User data
 /// </param>
 public void SavePhoto(Photo photo)
 {
     if (photo.Id == 0)
     {
         session.Insert<Photo>(photo);
     } else
     {
         session.Update<Photo>(photo);
     }
 }
Example #3
0
        private void AddPhotoButtonClicked(object sender,
		                             EventArgs args)
        {
            PhotoEditorWindow photoEditor = new PhotoEditorWindow (this);
            photoEditor.Run ();

            if (photoEditor.Photo != null) {
                Console.WriteLine ("Decided to save!");
                Photo photo = new Photo();
                photo.UserId = GetSelectedUser().Id;
                photo.ImageData = UserInfoManager.SerializeImage(photoEditor.Photo.Clone());

                userInfoManager.SavePhoto(photo);
            } else {
                Console.WriteLine ("Cancel!");
            }
        }