示例#1
0
        private void frmTransactionRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmOtherTransaction frm = new frmOtherTransaction();

            frm.Show();
        }
        private void othersTransactionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmOtherTransaction frm = new frmOtherTransaction();

            frm.label4.Text = UserType.Text;
            frm.Show();
        }
示例#3
0
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridViewRow dr = dataGridView1.SelectedRows[0];

            this.Hide();
            frmOtherTransaction frm = new frmOtherTransaction();

            // or simply use column name instead of index
            //dr.Cells["id"].Value.ToString();
            frm.Show();
            frm.txtTransactionID.Text = dr.Cells[0].Value.ToString();
            frm.dtp.Text = dr.Cells[2].Value.ToString();
            if (dr.Cells[1].Value.ToString() == "Debit")
            {
                frm.rbdebit.Checked = true;
            }
            else
            {
                frm.rbcredit.Checked = true;
            }
            frm.txtamt.Text = dr.Cells[3].Value.ToString();
            frm.txtdes.Text = dr.Cells[4].Value.ToString();

            if (label1.Text == "Admin")
            {
                frm.Delete.Enabled        = true;
                frm.Update_record.Enabled = true;
                frm.btnSave.Enabled       = false;
                frm.label4.Text           = label1.Text;
            }
            else
            {
                frm.Delete.Enabled        = false;
                frm.Update_record.Enabled = false;
                frm.btnSave.Enabled       = false;
                frm.label4.Text           = label1.Text;
            }
        }