示例#1
0
        private void frmProductsRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            Hide();
            var frm = new frmProduct();

            frm.Show();
        }
示例#2
0
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var dr = dataGridView1.SelectedRows[0];
                Hide();
                var frm = new frmProduct();
                frm.Show();
                frm.txtProductName.Text = dr.Cells[0].Value.ToString();
                frm.textBox1.Text       = dr.Cells[0].Value.ToString();
                frm.cmbCategory.Text    = dr.Cells[1].Value.ToString();
                frm.cmbCompany.Text     = dr.Cells[2].Value.ToString();
                frm.btnUpdate.Enabled   = true;
                frm.btnDelete.Enabled   = true;
                frm.btnSave.Enabled     = false;
                frm.txtProductName.Focus();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ล้มเหลว", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var dr = dataGridView1.SelectedRows[0];
                Hide();
                var frm = new frmProduct();
                frm.Show();
                frm.txtProductName.Text = dr.Cells[0].Value.ToString();
                frm.textBox1.Text = dr.Cells[0].Value.ToString();
                frm.cmbCategory.Text = dr.Cells[1].Value.ToString();
                frm.cmbCompany.Text = dr.Cells[2].Value.ToString();
                frm.btnUpdate.Enabled = true;
                frm.btnDelete.Enabled = true;
                frm.btnSave.Enabled = false;
                frm.txtProductName.Focus();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ล้มเหลว", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#4
0
 private void frmProductsRecord_FormClosing(object sender, FormClosingEventArgs e)
 {
     Hide();
     var frm = new frmProduct();
     frm.Show();
 }
示例#5
0
 private void productToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var frm = new frmProduct();
     frm.Show();
 }
示例#6
0
        private void productToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frm = new frmProduct();

            frm.Show();
        }