Пример #1
0
        private void listView2_DoubleClick(object sender, EventArgs e)
        {
            SqlDataAdapter sda     = new SqlDataAdapter(new SqlCommand(Trending, con));
            DataSet        dataset = new DataSet();

            sda.Fill(dataset);

            int firstSelectedItem = listView2.Items.IndexOf(listView2.SelectedItems[0]);
            int ID = int.Parse(dataset.Tables[0].Rows[firstSelectedItem]["ProductID"].ToString());

            if (A_UName.ID_PERMISSON > 2)
            {
                ProductInfo_Guest f = new ProductInfo_Guest(ID);
                f.ShowDialog();
            }
            else if (A_UName.ID_PERMISSON < 3)
            {
                ProductInfo_Staff f = new ProductInfo_Staff(ID);
                f.ShowDialog();

                if (f.Visible == false && ProductInfo_Staff.stateChange == 1)
                {
                    hot_Today_Items();
                    trending_Items();
                }
            }
        }
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0)
            {
                DataRowView drv = this.dataGridView1.CurrentRow.DataBoundItem as DataRowView;
                if (drv != null)
                {
                    int a = int.Parse(drv[0].ToString());
                    bd.UpdateFields(ref err, "EXEC [Increase View] " + a);

                    if (A_UName.ID_PERMISSON > 2)
                    {
                        ProductInfo_Guest f = new ProductInfo_Guest(a);
                        f.ShowDialog();
                    }
                    else if (A_UName.ID_PERMISSON < 3)
                    {
                        ProductInfo_Staff f = new ProductInfo_Staff(a);
                        f.ShowDialog();

                        if (f.Visible == false && ProductInfo_Staff.stateChange == 1)
                        {
                            Form_Product_Load(sender, e);
                        }
                    }
                }
            }
        }