예제 #1
0
        private void viewAndBuyProductsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UserAccountForm userAccount = new UserAccountForm();

            //make the current form the parent of AddMobile
            userAccount.MdiParent = this;
            //bring up the form
            userAccount.uName = uName;
            userAccount.Show();

            DisposeAllButThis(userAccount);
        }
예제 #2
0
        //when clicked on addtocart button in productgridview
        private void productsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 7)
            {
                brandLabel.Text   = this.productsGridView.CurrentRow.Cells[2].Value.ToString();
                productLabel.Text = this.productsGridView.CurrentRow.Cells[1].Value.ToString();
                MemoryStream ms = new MemoryStream((byte[])productsGridView.CurrentRow.Cells[3].Value);
                productImagePictureBox.Image = Image.FromStream(ms);
                productImagePictureBox.Show();
                priceLabel.Text      = this.productsGridView.CurrentRow.Cells[6].Value.ToString();
                quantityTextBox.Text = "1";
            }

            if (e.ColumnIndex == 3)
            {
                UserAccountForm f             = new UserAccountForm();
                MemoryStream    ms            = new MemoryStream((byte[])productsGridView.CurrentRow.Cells[3].Value);
                zoomImageForm   zoomImageForm = new zoomImageForm();
                zoomImageForm.zoomPictureBox.Image = Image.FromStream(ms);
                zoomImageForm.StartPosition        = FormStartPosition.CenterScreen;
                zoomImageForm.Show();
            }
        }//end function productsGridView_CellContentClick