Ejemplo n.º 1
0
        void getCARD()
        {
            frmRFID rf = new frmRFID();

            if (rf.connectCard())
            {
                string cardUID = rf.getcardUID();
                if (cardUID != "63000000")
                {
                    pc.uid       = cardUID;
                    id           = pc.getID();
                    lblRFID.Text = id;
                    if (id == "" || id == null)
                    {
                        lblRFID.Text = "No Record";
                        addPatient ap = new addPatient();
                        ap.uid = cardUID;
                        loadfrm(ap);
                    }
                    else
                    {
                        frmPatients fp = new frmPatients();
                        fp.txtSearch1.Text = lblRFID.Text;
                        loadfrm(fp);
                    }
                }
                else
                {
                    lblRFID.Text = "";
                }
            }
        }
Ejemplo n.º 2
0
 private void mtPatient_Click(object sender, EventArgs e)
 {
     if (focus == "add")
     {
         DialogResult res = MetroMessageBox.Show(this, "Data will be unsaved, Do you want to proceed?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (res == DialogResult.Yes)
         {
             frmPatients fp = new frmPatients();
             loadfrm(fp);
             focus = "x";
         }
     }
     else
     {
         frmPatients fp = new frmPatients();
         loadfrm(fp);
         focus = "x";
     }
 }
Ejemplo n.º 3
0
        private void txtPID_Leave(object sender, EventArgs e)
        {
            //txtPID.Text = (txtPID.Text == "") ? "1000000" : txtPID.Text;

            //if (txtPID.Text == "" || txtPID.Text== "1000000" || (txtPID.Text.Length>3 && txtPID.Text.Length <5) )
            //{
            //    cmbDepartment.Visible = false;
            //    cmbCourse.Visible = false;
            //    cmbYear.Visible = false;
            //    cmbDepartment.Enabled = false;
            //    cmbCourse.Enabled = false;
            //    cmbYear.Enabled = false;
            //    cmbDepartment.Text = "SEAIT";
            //    cmbYear.Text = "1st";
            //    cmbCourse.Text = "BSIT";
            //    gbImmu.Enabled = false;
            //    gbImmu.Visible = false;
            //}
            //else if(txtPID.Text.Length>7)
            //{
            //    cmbDepartment.Enabled = true;
            //    cmbCourse.Enabled = true;
            //    cmbYear.Enabled = true;
            //    gbImmu.Enabled = true;
            //    gbImmu.Visible = true;
            //    cmbDepartment.Visible = true;
            //    cmbCourse.Visible = true;
            //    cmbYear.Visible = true;
            //}
            pm.studentId = txtPID.Text;
            if (pm.verifyID() && txtPID.Text != "")
            {
                DialogResult res = MetroMessageBox.Show(this, "ID is already on the system \n" + "Do you want to view the record?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (res == DialogResult.Yes)
                {
                    frmPatients fp = new frmPatients();
                    fp.txtSearch1.Text = txtPID.Text;
                    fp.uid             = uid;
                    fp.ShowDialog();
                }
                txtPID.Text = "";
                txtPID.Focus();
            }
            //else
            //  {

            //      DialogResult res = MetroMessageBox.Show(this,"If Yes, Kindly Tap your ID Card to Card Reader","Register your SMU ID Card?",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
            //      if (res == DialogResult.Yes)
            //      {
            //          frmRFID rf = new frmRFID();
            //          for (int i = 0; i == 0; i++)
            //          {
            //              if (rf.connectCard())
            //              {
            //                  pm.uid = rf.getcardUID();
            //              }
            //              else
            //              {
            //                  pm.uid = "";
            //                  DialogResult ress = MetroMessageBox.Show(this, "No ID Card Recognized!", "Do you want to try again?", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning);
            //                  if (res == DialogResult.Retry)
            //                  {

            //                      i = 0;
            //                  }
            //              }
            //          }
            //          rf.Dispose();
            //      }
            //      MessageBox.Show(pm.uid);
            //  }
        }