public PhotosCollectionForm(User i_LogggedInUser, DataBaseProxy i_DataBaseProxy) { InitializeComponent(); LogggedInUser = i_LogggedInUser; DataBaseProxy = i_DataBaseProxy; InitPhotosCollection(); performDownloads(); }
private void performUploading(string path) { if (CloudinaryProxy == null) { MessageBox.Show("CloudinaryProxy object is null in MainForm.."); return; } else { string URL = CloudinaryProxy.UploadPhoto(path, LoggedInUser.UserName, LoggedInUser.UserName); int PhotoID = DataBaseProxy.InsertNewPhoto(LoggedInUser.UserName, URL); DataBaseProxy.InsertPhotoToCollection(LoggedInUser.ID, PhotoID); MessageBox.Show("The Photo was uploaded successfully to our server (cloudinary)"); UpdaterChecker.IsPhotosCollectionHasChanged = true; } }
private void buttonSell_Click(object sender, EventArgs e) { int price; bool boolResult = int.TryParse(textBoxPrice.Text, out price); if (imageListView1.SelectedItems[0] != null && boolResult) { Photo selectedPhotoForSell = LogggedInUser.PhotosCollection.ListOfPhotos.Find(x => x.photoId == (int)imageListView1.SelectedItems[0].Tag); MarketPhoto marketPhoto = new MarketPhoto() { userId = LogggedInUser.ID, photoId = selectedPhotoForSell.photoId, price = price, description = textBoxDescription.Text, Date = DateTime.Now.ToString() }; DataBaseProxy.InsertNewMarketPhoto(marketPhoto); LogggedInUser.PhotosCollection.deletePhoto(selectedPhotoForSell); imageListView1.Items.Remove(imageListView1.SelectedItems[0]); UpdaterChecker.IsMarketDataHasChanged = true; } panel1.Visible = false; textBoxPrice.Clear(); }
public Market(DataBaseProxy i_DataBaseProxy) { DataBaseProxy = i_DataBaseProxy; fetchListFromDataBase(); }
public User CreateNewUser(SQL_User i_SQL_User) { return(DataBaseProxy.CreateNewUser(i_SQL_User)); }
private void fetchUsers() { Users = DataBaseProxy.GetAllUsers(); }
private void InitProxies() { CloudinaryProxy = new CloudinaryProxy(); DataBaseProxy = new DataBaseProxy(); }
public PhotoProfileForm(DataBaseProxy i_DataBaseProxy) { InitializeComponent(); DataBaseProxy = i_DataBaseProxy; }
public void InitializeCollection(User i_User, DataBaseProxy i_DataBaseProxy) { UserOwner = i_User; DataBaseProxy = i_DataBaseProxy; InitListOfPhotosFromProxies(); }
public void updateBank(int i_Money, DataBaseProxy i_DataBaseProxy) { BankAccount.money = i_Money; i_DataBaseProxy.updateBank(BankAccount); }
public void InitPhotosCollection(DataBaseProxy i_DataBaseProxy) { PhotosCollection = new PhotosCollection(); PhotosCollection.InitializeCollection(this, i_DataBaseProxy); }