示例#1
0
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var dr = dataGridView1.SelectedRows[0];
                Hide();
                var obj = new frmConfig();


                obj.Show();
                obj.txtConfigID.Text    = dr.Cells[0].Value.ToString();
                obj.cmbProductName.Text = dr.Cells[1].Value.ToString();
                obj.txtFeatures.Text    = dr.Cells[2].Value.ToString();
                obj.txtPrice.Text       = dr.Cells[3].Value.ToString();
                var data = (byte[])dr.Cells[4].Value;
                var ms   = new MemoryStream(data);
                obj.pictureBox1.Image = Image.FromStream(ms);
                obj.btnUpdate.Enabled = true;
                obj.btnDelete.Enabled = true;
                obj.btnSave.Enabled   = false;
                obj.cmbProductName.Focus();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ล้มเหลว", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void frmConfigRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            Hide();
            var frm = new frmConfig();

            frm.Show();
        }
示例#3
0
 private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var frm = new frmConfig();
     frm.Show();
 }
示例#4
0
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var dr = dataGridView1.SelectedRows[0];
                Hide();
                var obj = new frmConfig();


                obj.Show();
                obj.txtConfigID.Text = dr.Cells[0].Value.ToString();
                obj.cmbProductName.Text = dr.Cells[1].Value.ToString();
                obj.txtFeatures.Text = dr.Cells[2].Value.ToString();
                obj.txtPrice.Text = dr.Cells[3].Value.ToString();
                var data = (byte[])dr.Cells[4].Value;
                var ms = new MemoryStream(data);
                obj.pictureBox1.Image = Image.FromStream(ms);
                obj.btnUpdate.Enabled = true;
                obj.btnDelete.Enabled = true;
                obj.btnSave.Enabled = false;
                obj.cmbProductName.Focus();
            }

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

            frm.Show();
        }