Exemple #1
0
        private void BtnSearchStudent_Click(object sender, EventArgs e)
        {
            ep.Clear();
            if (txtStudentID.Text.Trim().Length == 0)
            {
                ep.SetError(txtStudentID, "Öğrenci ID giriniz!");
                txtStudentID.Focus();
                return;
            }

            try
            {
                var s = StudentsHelper.GetStudentByID(Convert.ToInt32(txtStudentID.Text));
                FillGridStudent(s);
                btnSearchStudent.Enabled = false;
                txtStudentID.Enabled     = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Bu ID'ye ait öğrenci bulunamadı", "Library Management System", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (btnSearchBook.Enabled == false || btnSearchStudent.Enabled == false)
            {
                btnCancel.Enabled = true;
            }
            if (btnSearchBook.Enabled == false && btnSearchStudent.Enabled == false)
            {
                btnAdd.Enabled = true;
            }
        }
Exemple #2
0
        private void btnSearchStudent_Click(object sender, EventArgs e)
        {
            ep.Clear();
            if (txtStudentID.Text.Trim().Length == 0)
            {
                ep.SetError(txtStudentID, "Öğrenci ID giriniz!");
                txtStudentID.Focus();
                return;
            }

            try
            {
                var s = StudentsHelper.GetStudentByID(Convert.ToInt32(txtStudentID.Text));
                FillGridStudent(s);
                FillGridBook(Convert.ToInt32(txtStudentID.Text));
                if (dgvIssueBookList.Rows.Count > 0)
                {
                    btnSearchStudent.Enabled   = false;
                    btnSelectIssueBook.Enabled = true;
                    txtStudentID.Enabled       = false;
                    dgvIssueBookList.Enabled   = true;
                }
                else
                {
                    MessageBox.Show("Bu ID'ye ait öğrencide kitap yoktur.", "Library Management System", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Bu ID'ye ait öğrenci bulunamadı", "Library Management System", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
        private void btnSelectFine_Click(object sender, EventArgs e)
        {
            if (dgvFineList.Rows.Count > 0)
            {
                if (dgvFineList.SelectedRows.Count == 1)
                {
                    int selectIndex = dgvFineList.CurrentRow.Index;
                    var studentID   = dgvFineList.Rows[selectIndex].Cells[1].Value;

                    dgvFineList.Enabled   = false;
                    gbStudent.Enabled     = true;
                    btnCancel.Enabled     = true;
                    btnSelectFine.Enabled = false;

                    var s = StudentsHelper.GetStudentByID(Convert.ToInt32(studentID));
                    FillGridStudent(s);
                }
            }
        }