Beispiel #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            String SALES_ID = dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value.ToString();

            if (dataGridView1.Rows[e.RowIndex].Cells["Column3"].Value.ToString() == "QuickSale")
            {
                //////
                frmSales frmSales = Application.OpenForms["frmSales"] as frmSales;
                if (frmSales != null)
                {
                    frmSales.WindowState = FormWindowState.Normal;
                    frmSales.BringToFront();
                    frmSales.Activate();
                }
                else
                {
                    frmSales           = new frmSales(SALES_ID);
                    frmSales.MdiParent = this.ParentForm;
                    frmSales.Dock      = DockStyle.Fill;
                    frmSales.Show();
                }
                ///////////
            }
            else if (dataGridView1.Rows[e.RowIndex].Cells["Column3"].Value.ToString() == "POS")
            {
                //////
                frmPOS frmPOS = Application.OpenForms["frmPOS"] as frmPOS;
                if (frmPOS != null)
                {
                    frmPOS.WindowState = FormWindowState.Normal;
                    frmPOS.BringToFront();
                    frmPOS.Activate();
                }
                else
                {
                    frmPOS           = new frmPOS(SALES_ID);
                    frmPOS.MdiParent = this.ParentForm;
                    frmPOS.Dock      = DockStyle.Fill;
                    frmPOS.Show();
                }
                ///////////
            }
            else
            {
            }
        }
Beispiel #2
0
        private void salesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Sales
            frmSales frmSales = Application.OpenForms["frmSales"] as frmSales;

            if (frmSales != null)
            {
                frmSales.WindowState = FormWindowState.Normal;
                frmSales.BringToFront();
                frmSales.Activate();
            }
            else
            {
                frmSales           = new frmSales("0");
                frmSales.MdiParent = this;
                frmSales.Dock      = DockStyle.Fill;
                frmSales.Show();
            }
        }