Example #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            this.Dispose();
            QuotationForCustom frm = new QuotationForCustom();

            frm.Show();
        }
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (ftype == 1)
            {
                try
                {
                    DataGridViewRow dr = dataGridView1.SelectedRows[0];

                    this.Dispose();
                    QuotationForOvercease frm = new QuotationForOvercease();
                    frm.Show();
                    frm.txtClientId.Text         = dr.Cells[0].Value.ToString();
                    frm.txtClientName.Text       = dr.Cells[1].Value.ToString();
                    frm.labelm.Text              = labeln.Text;
                    frm.BrandcomboBox.Enabled    = true;
                    frm.txtOProductId.Enabled    = false;
                    frm.txtOSProductName.Enabled = false;
                    frm.groupBox3.Enabled        = false;
                    frm.groupBox2.Enabled        = false;
                    frm.groupBox7.Enabled        = false;
                    frm.dateTimePicker1.Focus();
                    //frm.txtAttention.Focus();
                    // this.Dispose();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (ftype == 3)
            {
                try
                {
                    DataGridViewRow dr = dataGridView1.SelectedRows[0];

                    this.Dispose();
                    Quotation frm = new Quotation();
                    frm.Show();
                    frm.txtClientId.Text        = dr.Cells[0].Value.ToString();
                    frm.txtClientName.Text      = dr.Cells[1].Value.ToString();
                    frm.labelm.Text             = labeln.Text;
                    frm.BrandcomboBox.Enabled   = true;
                    frm.txtProId.Enabled        = false;
                    frm.txtSProductName.Enabled = false;
                    frm.groupBox3.Enabled       = false;
                    frm.groupBox2.Enabled       = false;
                    frm.groupBox7.Enabled       = false;
                    frm.dateTimePicker1.Focus();
                    //frm.txtAttention.Focus();
                    // this.Dispose();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (ftype == 2)
            {
                try
                {
                    DataGridViewRow dr = dataGridView1.SelectedRows[0];

                    this.Dispose();
                    QuotationForCustom frm = new QuotationForCustom();
                    frm.Show();
                    frm.txtClientId.Text      = dr.Cells[0].Value.ToString();
                    frm.txtClientName.Text    = dr.Cells[1].Value.ToString();
                    frm.BrandcomboBox.Enabled = true;
                    frm.groupBox3.Enabled     = false;
                    frm.groupBox2.Enabled     = false;
                    frm.groupBox7.Enabled     = false;
                    frm.labelm.Text           = labeln.Text;
                    frm.dateTimePicker1.Focus();
                    //frm.txtAttention.Focus();
                    // this.Dispose();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (ftype == 4)
            {
                try
                {
                    DataGridViewRow dr = dataGridView1.SelectedRows[0];

                    this.Dispose();
                    QuotationMMix frm = new QuotationMMix();
                    frm.Show();

                    frm.txtClientId.Text   = dr.Cells[0].Value.ToString();
                    frm.txtClientName.Text = dr.Cells[1].Value.ToString();
                    frm.labelm.Text        = labeln.Text;
                    frm.dateTimePicker1.Focus();
                    //frm.txtAttention.Focus();
                    // this.Dispose();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }