private void favoritesButton_Click(object sender, EventArgs e) { favorites fav = new favorites(userId); fav.Show(); fav.Location = this.Location; this.Hide(); }
private void buyButton_Click(object sender, EventArgs e) { favorites f = (favorites)this.ParentForm; orderConfirmation o = new orderConfirmation(pId, uId); o.Location = f.Location; f.Hide(); o.Show(); }
private void removeFromCart_Click(object sender, EventArgs e) { connection.Open(); SqlCommand deleteCart = new SqlCommand(removeItem, connection); deleteCart.Parameters.AddWithValue("@prod", pId); deleteCart.Parameters.AddWithValue("@user", uId); deleteCart.ExecuteNonQuery(); connection.Close(); favorites c = (favorites)this.ParentForm; this.Parent.Controls.Remove(this); c.createFavObjects(); }