Example #1
0
        private void bookReturnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBookReturn frm = new frmBookReturn();

            frm.lblUserType.Text = UserType.Text;
            frm.lblUser.Text     = User.Text;
            frm.Show();
        }
        private void frmBookReturn_Student__FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmBookReturn frm = new frmBookReturn();

            frm.lblUserType.Text = lblUserType.Text;
            frm.lblUser.Text     = lblUser.Text;
            frm.Show();
        }
        private void frmBookReturnRecord_Staff__FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmBookReturn frm = new frmBookReturn();

            frm.TabControl1.SelectedTab = frm.TabPage2;
            frm.lblUserType.Text        = lblUserType.Text;
            frm.lblUser.Text            = lblUser.Text;
            frm.Show();
        }
 private void frmBookIssueRecord_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (Set10.Text == "Book Return")
     {
         this.Hide();
         frmBookReturn frm = new frmBookReturn();
         frm.lblUserType.Text = lblUserType.Text;
         frm.lblUser.Text     = lblUser.Text;
         frm.Show();
     }
     else
     {
         this.Hide();
         frmStudentBookIssue frm = new frmStudentBookIssue();
         frm.lblUserType.Text = lblUserType.Text;
         frm.lblUser.Text     = lblUser.Text;
         frm.Show();
     }
 }
        private void dataGridView5_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                DataGridViewRow dr = dataGridView5.SelectedRows[0];
                this.Hide();
                frmBookReturn frm = new frmBookReturn();
                frm.TabControl1.SelectedTab = frm.TabPage2;
                frm.Show();
                frm.txtReturnID1.Text      = dr.Cells[0].Value.ToString();
                frm.dtpReturnDate1.Text    = dr.Cells[1].Value.ToString();
                frm.txtFine1.Text          = dr.Cells[2].Value.ToString();
                frm.txtTransactionID1.Text = dr.Cells[3].Value.ToString();
                frm.dtpIssueDate1.Text     = dr.Cells[4].Value.ToString();

                frm.dtpDueDate1.Text = dr.Cells[5].Value.ToString();


                frm.txtAccessionNo1.Text = dr.Cells[6].Value.ToString();
                frm.txtBookTitle1.Text   = dr.Cells[7].Value.ToString();
                frm.txtAuthor1.Text      = dr.Cells[8].Value.ToString();
                frm.txtsubject1.Text     = dr.Cells[9].Value.ToString();
                frm.txtISBN1.Text        = dr.Cells[10].Value.ToString();

                frm.txtEdition1.Text    = dr.Cells[11].Value.ToString();
                frm.txtStaffName.Text   = dr.Cells[13].Value.ToString();
                frm.txtStaffID.Text     = dr.Cells[12].Value.ToString();
                frm.txtDepartment1.Text = dr.Cells[14].Value.ToString();
                frm.lblUser.Text        = lblUser.Text;
                frm.lblUserType.Text    = lblUserType.Text;
                frm.btnDelete1.Enabled  = true;
                frm.btnUpdate1.Enabled  = true;

                frm.btnSave.Enabled = false;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void dataGridView5_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                DataGridViewRow dr = dataGridView5.SelectedRows[0];
                this.Hide();
                frmBookReturn frm = new frmBookReturn();
                frm.Show();
                frm.txtReturnID.Text      = dr.Cells[0].Value.ToString();
                frm.txtTransactionID.Text = dr.Cells[3].Value.ToString();
                frm.dtpIssueDate.Text     = dr.Cells[4].Value.ToString();

                frm.dtpDueDate.Text     = dr.Cells[5].Value.ToString();
                frm.txtFine.Text        = dr.Cells[2].Value.ToString();
                frm.dtpReturnDate.Text  = dr.Cells[1].Value.ToString();
                frm.txtAccessionNo.Text = dr.Cells[6].Value.ToString();
                frm.txtBookTitle.Text   = dr.Cells[7].Value.ToString();
                frm.txtAuthor.Text      = dr.Cells[5].Value.ToString();
                frm.txtSubject.Text     = dr.Cells[8].Value.ToString();
                frm.txtISBN.Text        = dr.Cells[9].Value.ToString();

                frm.txtEdition.Text          = dr.Cells[10].Value.ToString();
                frm.txtStudentName.Text      = dr.Cells[12].Value.ToString();
                frm.AdmissionNo.Text         = dr.Cells[11].Value.ToString();
                frm.txtClass.Text            = dr.Cells[13].Value.ToString();
                frm.txtSection.Text          = dr.Cells[14].Value.ToString();
                frm.lblUser.Text             = lblUser.Text;
                frm.lblUserType.Text         = lblUserType.Text;
                frm.btnDelete.Enabled        = true;
                frm.btnUpdate_record.Enabled = true;

                frm.btnSave.Enabled = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #7
0
        private void dataGridView4_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                if (SET.Text == "Book Issues")
                {
                    DataGridViewRow dr = dataGridView4.SelectedRows[0];
                    this.Hide();
                    frmStudentBookIssue frm = new frmStudentBookIssue();
                    frm.Show();

                    frm.TabControl1.SelectedTab = frm.TabPage2;
                    frm.txtTransactionID1.Text  = dr.Cells[0].Value.ToString();
                    frm.dtpIssueDate1.Text      = dr.Cells[1].Value.ToString();
                    frm.dtpDueDate1.Text        = dr.Cells[2].Value.ToString();
                    frm.cmbAccessionNo1.Text    = dr.Cells[3].Value.ToString();
                    frm.txtBookTitle1.Text      = dr.Cells[4].Value.ToString();
                    frm.txtAuthor1.Text         = dr.Cells[5].Value.ToString();
                    frm.txtsubject1.Text        = dr.Cells[6].Value.ToString();
                    frm.txtISBN1.Text           = dr.Cells[7].Value.ToString();

                    frm.txtEdition1.Text         = dr.Cells[8].Value.ToString();
                    frm.txtStaffName.Text        = dr.Cells[10].Value.ToString();
                    frm.cmbStaffID.Text          = dr.Cells[9].Value.ToString();
                    frm.txtDepartment1.Text      = dr.Cells[11].Value.ToString();
                    frm.lblUser.Text             = lblUser.Text;
                    frm.lblUserType.Text         = lblUserType.Text;
                    frm.btnDelete.Enabled        = true;
                    frm.btnUpdate_record.Enabled = true;
                    frm.btnDelete1.Enabled       = true;
                    frm.btnUpdate1.Enabled       = true;
                    frm.btnSave.Enabled          = false;
                }
                else
                {
                    DataGridViewRow dr = dataGridView4.SelectedRows[0];
                    this.Hide();
                    frmBookReturn frm = new frmBookReturn();
                    // or simply use column name instead of index
                    //dr.Cells["id"].Value.ToString();
                    frm.Show();

                    frm.TabControl1.SelectedTab = frm.TabPage2;
                    frm.txtTransactionID1.Text  = dr.Cells[0].Value.ToString();
                    frm.dtpIssueDate1.Text      = dr.Cells[1].Value.ToString();

                    frm.dtpDueDate1.Text     = dr.Cells[2].Value.ToString();
                    frm.txtAccessionNo1.Text = dr.Cells[3].Value.ToString();
                    frm.txtBookTitle1.Text   = dr.Cells[4].Value.ToString();
                    frm.txtAuthor1.Text      = dr.Cells[5].Value.ToString();
                    frm.txtsubject1.Text     = dr.Cells[6].Value.ToString();
                    frm.txtISBN1.Text        = dr.Cells[7].Value.ToString();

                    frm.txtEdition1.Text  = dr.Cells[8].Value.ToString();
                    frm.txtStaffName.Text = dr.Cells[9].Value.ToString();
                    frm.txtStaffID.Text   = dr.Cells[10].Value.ToString();

                    frm.txtDepartment1.Text = dr.Cells[11].Value.ToString();
                    frm.lblUser.Text        = lblUser.Text;
                    frm.lblUserType.Text    = lblUserType.Text;

                    frm.btnDelete1.Enabled = false;
                    frm.btnUpdate1.Enabled = false;

                    frm.btnSave.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }