//public void LoadImageTemp() //{ // Photo photo = new Photo(); // string ProfileCoverImagePath = ""; // string ProfileImagePath = ""; // List<Photo> PhotoList = Photo.SelectAllByContextId(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString())); // if (PhotoList.Count > 0) // { // foreach (Photo _List in PhotoList) // { // if (_List.PhotoCategoryId == (int)Enums.PhotoCategory.Cover_Picture) // { // ProfileCoverImagePath = _List.FilePath; // } // if (_List.PhotoCategoryId == (int)Enums.PhotoCategory.Profile_Picture) // { // ProfileImagePath = _List.FilePath; // } // } // } // if (ProfileImagePath != string.Empty) // { // try // { // string images = photo.LoadProfileImage(ProfileImagePath); // if (images != string.Empty) // { // ProfileImage_.ImageUrl = images; // } // } // catch (Exception ec) // { } // } // if (ProfileCoverImagePath != string.Empty) // { // try // { // string CoverImages = photo.LoadProfileCoverImage(ProfileCoverImagePath); // if (CoverImages != string.Empty) // { // CoverImage.ImageUrl = CoverImages; // } // } // catch (Exception ec) // { } // } // else // { // } //} protected void btn_Photos_Click(object sender, EventArgs e) { Photo photo = new Photo(); string path = "~/uploads/" + Membership.GetUser().ProviderUserKey.ToString(); bool IsUpload = photo.ImageResize(FileUploads, path, photo); if (IsUpload == true) { photo.ContextId = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()); photo.ContextTypeId = (int)Enums.ContextType.Student; photo.PhotoCategoryId = (int)Enums.PhotoCategory.Profile_Picture; photo.Insert(photo); } Response.Redirect("~/Student/Student_Profile.aspx"); }
protected void PhotoButton_Click(object sender, EventArgs e) { if (Page.IsValid == true) { Photo photo = new Photo(); string path = "~/uploads/" + Membership.GetUser().ProviderUserKey.ToString(); bool IsUpload = photo.ImageResize(PhotoUpload, path, photo); if (IsUpload == true) { comment.CommentText = PhotoUploadComment.Text.Trim(); comment.CreatedBy = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()); comment.ContextTypeId = (int)Enums.ContextType.Landlord; comment.CommentTypeId = (int)Enums.CommentType.Photo; comment.FilePath = photo.FilePath; comment.RatingValue = 0; save(comment); string AccessCode = Utility.GetQueryStringValueByKey(Request, "AccessCode"); string AccessCode2 = Utility.GetQueryStringValueByKey(Request, "AccessCode2"); Response.Redirect("~/Land_load/Land_load_Public_Profile.aspx?AccessCode=" + AccessCode + "&AccessCode2=" + AccessCode2); } } }