private void get_Student_RGP(string rfid)
 {
     try
     {
         DataTable dt = new DataTable();
         dt = setup_Datatable.datatable_Student_RGP(rfid);
         if (dt.Rows.Count == 1)
         {
             studentRGP = dt.Rows[0]["RGP"].ToString().Trim();
             timer1.Stop();
             timer2.Stop();
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         else if (dt.Rows.Count == 0)
         {
             lb_Info.Text = "Please Tap Student Card";
             alertControl1.Show(this, "Data center", "Student not found !", gbr_error);
             timer1.Start();
             textBox1.Focus();
         }
     }
     catch (Exception ex)
     {
         this.Close();
         throw ex;
     }
 }
Example #2
0
        private void get_Student_RGP(string rfid)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = setup_Datatable.datatable_Student_RGP(rfid);
                if (dt.Rows.Count == 1)
                {
                    string RGP = dt.Rows[0]["RGP"].ToString().Trim();

                    if (RGP.Trim() == _student_RGP.Trim())
                    {
                        timer1.Stop();
                        timer2.Stop();
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        alertControl1.Show(this, "Data center", "Miss match student !", gbr_error);
                        MessageBox.Show("Student does not have any private instruction session running", "Axioma Agent", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (dt.Rows.Count == 0)
                {
                    lb_Info.Text = "Please Tap Student Card";
                    alertControl1.Show(this, "Data center", "Student not found !", gbr_error);
                    timer1.Start();
                    textBox1.Focus();
                }
            }
            catch (Exception ex)
            {
                this.Close();
                throw ex;
            }
        }
        private void get_Student_RGP(string rfid)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = setup_Datatable.datatable_Student_RGP(rfid);
                if (dt.Rows.Count == 1)
                {
                    int RGP = Convert.ToInt32(dt.Rows[0]["RGP"].ToString().Trim());
                    student_RGP          = RGP.ToString();
                    lb_Student_RGP.Text  = "RGP: " + RGP.ToString();
                    lb_Student_Name.Text = dt.Rows[0]["preferredName"].ToString();

                    try
                    {
                        string img_path = utils.get_Student_Image(Img_member_Url, RGP.ToString());
                        if (!string.IsNullOrEmpty(img_path))
                        {
                            using (var bmpTemp = new Bitmap(img_path))
                            {
                                Image imgs = new Bitmap(bmpTemp);
                                pictureEdit_Student_Attendees.Image = imgs;
                            }
                        }
                        else
                        {
                            pictureEdit_Student_Attendees.Image = Properties.Resources.Default_Image;
                        }
                    }
                    catch (Exception ex)
                    {
                        pictureEdit_Student_Attendees.Image = null;
                        lb_Info.Text = "Please Tap Student Card";
                        MessageBox.Show(ex.Message);
                    }


                    DataTable dt2 = new DataTable();
                    dt2 = setup_Datatable.datatable_PrivateInstruction(RGP);

                    if (dt2.Rows.Count != 0)
                    {
                        gridControl1.DataSource = dt2;
                        timer1.Stop();
                        gridView1.Focus();
                        gridView1.FocusedRowHandle = 0;
                        lb_Info.Text = "Press ENTER Key To Select";
                        arrangeCol();
                        textBox1.Enabled = false;
                        cmb_Room.Visible = true;
                        lb_Room.Visible  = true;
                    }
                    else
                    {
                        gridControl1.DataSource = null;
                        alertControl1.Show(this, "Data center", "Training package not found !", gbr_error);
                        lb_Info.Text = "Please Tap Student Card";
                        timer1.Start();
                        textBox1.Focus();
                    }
                }
                else if (dt.Rows.Count == 0)
                {
                    lb_Student_RGP.Text  = "";
                    lb_Student_Name.Text = "";
                    pictureEdit_Student_Attendees.Image = null;
                    lb_Info.Text = "Please Tap Student Card";

                    gridControl1.DataSource = null;
                    alertControl1.Show(this, "Data center", "Student not found !", gbr_error);
                    timer1.Start();
                    textBox1.Focus();
                }
            }
            catch (Exception ex)
            {
                this.Close();
                throw ex;
            }
        }
Example #4
0
        private void get_Student_RGP(string rfid)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = setup_Datatable.datatable_Student_RGP(rfid);
                if (dt.Rows.Count == 1)
                {
                    string RGP = dt.Rows[0]["RGP"].ToString().Trim();

                    if (RGP.Trim() == _student_RGP.Trim())
                    {
                        timer1.Stop();
                        timer2.Stop();
                        if (_isFinger)
                        {
                            PT_fingerEnd pt_fingerend = new PT_fingerEnd(_dt_finger_employees, _clubName, _room, _product_Name, _employee_Start, _employee_StartName, _counter_PTSession, _student_RGP);
                            if (pt_fingerend.ShowDialog() == DialogResult.OK)
                            {
                                this.DialogResult = DialogResult.OK;
                                this.Close();
                            }
                            else
                            {
                                this.DialogResult = DialogResult.Cancel;
                                this.Close();
                            }
                        }
                        else
                        {
                            PT_cardEnd PT_cardEnd = new PT_cardEnd(_clubName, _room, _product_Name, _employee_Start, _employee_StartName, _counter_PTSession, _student_RGP);
                            if (PT_cardEnd.ShowDialog() == DialogResult.OK)
                            {
                                this.DialogResult = DialogResult.OK;
                                this.Close();
                            }
                            else
                            {
                                this.DialogResult = DialogResult.Cancel;
                                this.Close();
                            }
                        }
                    }
                    else
                    {
                        alertControl1.Show(this, "Data center", "Miss match student !", gbr_error);
                        MessageBox.Show("Student does not have any private instruction session running", "Axioma Agent", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (dt.Rows.Count == 0)
                {
                    lb_Info.Text = "Please Tap Student Card";
                    alertControl1.Show(this, "Data center", "Student not found !", gbr_error);
                    timer1.Start();
                    textBox1.Focus();
                }
            }
            catch (Exception ex)
            {
                this.Close();
                throw ex;
            }
        }