Exemplo n.º 1
0
 public PhotosCollectionForm(User i_LogggedInUser, DataBaseProxy i_DataBaseProxy)
 {
     InitializeComponent();
     LogggedInUser = i_LogggedInUser;
     DataBaseProxy = i_DataBaseProxy;
     InitPhotosCollection();
     performDownloads();
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
 public Market(DataBaseProxy i_DataBaseProxy)
 {
     DataBaseProxy = i_DataBaseProxy;
     fetchListFromDataBase();
 }
Exemplo n.º 5
0
 public User CreateNewUser(SQL_User i_SQL_User)
 {
     return(DataBaseProxy.CreateNewUser(i_SQL_User));
 }
Exemplo n.º 6
0
 private void fetchUsers()
 {
     Users = DataBaseProxy.GetAllUsers();
 }
Exemplo n.º 7
0
 private void InitProxies()
 {
     CloudinaryProxy = new CloudinaryProxy();
     DataBaseProxy   = new DataBaseProxy();
 }
Exemplo n.º 8
0
 public PhotoProfileForm(DataBaseProxy i_DataBaseProxy)
 {
     InitializeComponent();
     DataBaseProxy = i_DataBaseProxy;
 }
Exemplo n.º 9
0
 public void InitializeCollection(User i_User, DataBaseProxy i_DataBaseProxy)
 {
     UserOwner     = i_User;
     DataBaseProxy = i_DataBaseProxy;
     InitListOfPhotosFromProxies();
 }
Exemplo n.º 10
0
 public void updateBank(int i_Money, DataBaseProxy i_DataBaseProxy)
 {
     BankAccount.money = i_Money;
     i_DataBaseProxy.updateBank(BankAccount);
 }
Exemplo n.º 11
0
 public void InitPhotosCollection(DataBaseProxy i_DataBaseProxy)
 {
     PhotosCollection = new PhotosCollection();
     PhotosCollection.InitializeCollection(this, i_DataBaseProxy);
 }