Beispiel #1
0
        private void Promotion_Click(object sender, EventArgs e)
        {
            frmPromotion Promotion = new frmPromotion();

            Promotion.MdiParent   = this;
            Promotion.WindowState = FormWindowState.Normal;
            Promotion.Show();
        }
Beispiel #2
0
        private void dgvData_MouseClick(object sender, MouseEventArgs e)
        {
            String strSelProdId   = String.Empty;
            String strSelConfigId = String.Empty;
            String strSelLoginId  = String.Empty;
            String strTypeId      = String.Empty;
            String strHostName    = String.Empty;
            String strPromoId     = String.Empty;

            Int32 selectedRowCount =
                dgvData.Rows.GetRowCount(DataGridViewElementStates.Selected);

            if (selectedRowCount > 0)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();

                for (int i = 0; i < selectedRowCount; i++)
                {
                    sb.Append("Row: ");
                    sb.Append(dgvData.SelectedRows[i].Index.ToString());
                    sb.Append(Environment.NewLine);
                }

                sb.Append("Total: " + selectedRowCount.ToString());
                //MessageBox.Show(sb.ToString(), "Selected Rows");
            }
            if (isProduct)
            {
                if (dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value == null)
                {
                    strSelProdId = String.Empty;
                }
                else
                {
                    strSelProdId = dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value.ToString();
                }
                FrmProd = new frmProduct(strSelProdId);
                FrmProd.ShowDialog();
                bt_Product.PerformClick();
            }
            if (isSysConfig)
            {
                if (dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value == null)
                {
                    strSelConfigId = String.Empty;
                }
                else
                {
                    strSelConfigId = dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value.ToString();
                }
                FrmSysConfig = new frmSysConfig(strSelConfigId);
                FrmSysConfig.ShowDialog();
                bt_SysConfig.PerformClick();
            }
            if (isLoginUser)
            {
                if (dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value == null)
                {
                    strSelLoginId = String.Empty;
                }
                else
                {
                    strSelLoginId = dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value.ToString();
                }
                FrmLoginUser = new frmLoginUser(strSelLoginId);
                FrmLoginUser.ShowDialog();
                bt_LoginUser.PerformClick();
            }

            if (isPType)
            {
                if (dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value == null)
                {
                    strTypeId = String.Empty;
                }
                else
                {
                    strTypeId = dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value.ToString();
                }
                FrmProdType = new frmProdType(strTypeId);
                FrmProdType.ShowDialog();
                bt_ProdType.PerformClick();
            }
            if (isStation)
            {
                if (dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value == null)
                {
                    strHostName = String.Empty;
                }
                else
                {
                    strHostName = dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value.ToString();
                }
                FrmStations = new frmStations(strHostName);
                FrmStations.ShowDialog();
                bt_Station.PerformClick();
            }
            if (isPromotion)
            {
                if (dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value == null)
                {
                    strPromoId = String.Empty;
                }
                else
                {
                    strPromoId = dgvData.Rows[dgvData.SelectedRows[0].Index].Cells[0].Value.ToString();
                }
                FrmPromotion = new frmPromotion(strPromoId);
                FrmPromotion.ShowDialog();
                bt_Promotion.PerformClick();
            }
        }