Ejemplo n.º 1
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            StudentMenuForm form = new StudentMenuForm(StaffId, permission);

            form.Show();
            this.Dispose();
        }
Ejemplo n.º 2
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            StudentMenuForm form = new StudentMenuForm(staffId, passedPermission);

            form.Show();
            Close();
        }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtPayableAmt.Text != "0" || string.IsNullOrEmpty(txtPayableAmt.Text))
     {
         int result = StudentBLL.MakePayment(tempStudentID, float.Parse(txtPayableAmt.Text),
                                             DateTime.Parse(dtpDate.Value.ToString(dateFormat)), StaffId, txtRemark.Text);
         MessageBox.Show(result == 1
                     ? SportRegistrationSystem.lblPaymentSuccess
                     : SportRegistrationSystem.lblPaymentFailed);
         if (result == 1)
         {
             DialogResult dialogResult = MessageBox.Show("Print Receipt?", "Print Receipt Prompt", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 PrintDialog   printDialog   = new PrintDialog();
                 PrintDocument printDocument = new PrintDocument();
                 printDialog.Document     = printDocument;
                 printDocument.PrintPage += CreateReceipt;
                 if (printDialog.ShowDialog() == DialogResult.OK)
                 {
                     printDocument.Print();
                 }
             }
         }
         StudentMenuForm form = new StudentMenuForm(StaffId, passedPermission);
         form.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show(SportRegistrationSystem.lblInvalidValue);
     }
 }
Ejemplo n.º 4
0
        private void btnStudentManagement_Click(object sender, EventArgs e)
        {
            StudentMenuForm form = new StudentMenuForm(StaffId, permission);

            form.Show();
            this.Close();
        }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     StudentMenuForm form = new StudentMenuForm(StaffId, permission);
     if (!Authenticate.Authentication(StaffId, permission)) return;
     if (!string.IsNullOrEmpty(txtStudentName.Text) || !string.IsNullOrEmpty(txtContactNumber.Text))
     {
         int gender = -1;
         switch (cbGender.SelectedItem.ToString())
         {
             case "Male":
                 {
                     gender = 0;
                     break;
                 }
             case "Female":
                 {
                     gender = 1;
                     break;
                 }
         }
         bool registrationStatus = StudentBLL.RegisterStudent(txtStudentName.Text,
             (int) System.Enum.Parse(typeof (GradeEnum), cbGrade.SelectedValue.ToString()),
             DateTime.Parse(dtp1.Value.ToString(dateFormat)), Convert.ToInt32(txtContactNumber.Text), gender, StaffId);
         MessageBox.Show(registrationStatus
             ? SportRegistrationSystem.lblRegisterSuccess
             : SportRegistrationSystem.lblRegisterFailed);
         if (registrationStatus)
         {
             form.Show();
             this.Dispose();
         }
     }
 }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            DataTable dt = (DataTable)dataGridView1.DataSource;

            StudentBLL.UpdateStudentTable(dt);
            StudentMenuForm form = new StudentMenuForm(StaffId, passedPermission);

            form.Show();
            Close();
        }
Ejemplo n.º 7
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            StudentMenuForm form = new StudentMenuForm(StaffId, permission);

            if (!Authenticate.Authentication(StaffId, permission))
            {
                return;
            }
            if (!string.IsNullOrEmpty(txtStudentName.Text) || !string.IsNullOrEmpty(txtContactNumber.Text))
            {
                int gender = -1;
                switch (cbGender.SelectedItem.ToString())
                {
                case "Male":
                {
                    gender = 0;
                    break;
                }

                case "Female":
                {
                    gender = 1;
                    break;
                }
                }
                bool registrationStatus = StudentBLL.RegisterStudent(txtStudentName.Text,
                                                                     (int)System.Enum.Parse(typeof(GradeEnum), cbGrade.SelectedValue.ToString()),
                                                                     DateTime.Parse(dtp1.Value.ToString(dateFormat)), Convert.ToInt32(txtContactNumber.Text), gender, StaffId);
                MessageBox.Show(registrationStatus
                    ? SportRegistrationSystem.lblRegisterSuccess
                    : SportRegistrationSystem.lblRegisterFailed);
                if (registrationStatus)
                {
                    form.Show();
                    this.Dispose();
                }
            }
        }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     StudentMenuForm form = new StudentMenuForm(staffId, passedPermission);
     form.Show();
     Close();
 }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtPayableAmt.Text != "0" || string.IsNullOrEmpty(txtPayableAmt.Text))
     {
         int result = StudentBLL.MakePayment(tempStudentID, float.Parse(txtPayableAmt.Text),
         DateTime.Parse(dtpDate.Value.ToString(dateFormat)), StaffId, txtRemark.Text);
         MessageBox.Show(result == 1
                     ? SportRegistrationSystem.lblPaymentSuccess
                     : SportRegistrationSystem.lblPaymentFailed);
         if (result == 1)
         {
             DialogResult dialogResult = MessageBox.Show("Print Receipt?", "Print Receipt Prompt", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 PrintDialog printDialog = new PrintDialog();
                 PrintDocument printDocument = new PrintDocument();
                 printDialog.Document = printDocument;
                 printDocument.PrintPage += CreateReceipt;
                 if (printDialog.ShowDialog() == DialogResult.OK)
                 {
                     printDocument.Print();
                 }
             }
         }
         StudentMenuForm form = new StudentMenuForm(StaffId, passedPermission);
         form.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show(SportRegistrationSystem.lblInvalidValue);
     }
 }
Ejemplo n.º 10
0
 private void btnStudentManagement_Click(object sender, EventArgs e)
 {
     StudentMenuForm form = new StudentMenuForm(StaffId, permission);
     form.Show();
     this.Close();
 }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     StudentMenuForm form = new StudentMenuForm(StaffId, permission);
     form.Show();
     this.Dispose();
 }