public void get_Employee_Status(string rfid) { setup_Datatable setup = new setup_Datatable(); DataTable dt = setup.datatable_instructor_RFID(rfid); if (dt.Rows.Count == 0) { alertControl1.Show(this, "Data center", "Instructor not found", gbr_warn); return; } else { timer1.Stop(); string msg = ""; if (_instructorCode.Trim() == dt.Rows[0]["employeeStart"].ToString().Trim()) { msg = "Do you want to start using <b>" + _studentName + " - " + _productName + "</b> private session, teach by <b>" + dt.Rows[0]["preferredName"].ToString().Trim() + "</b> ?"; } else { msg = "<b>" + _instructorName + "</b> is the registered instructor for this private instruction package. \nDo you want to start using <b>" + _studentName + " - " + _productName + "</b> private session, teach by <b>" + dt.Rows[0]["preferredName"].ToString().Trim() + "</b> ?"; } Cst_Form_Long form = new Cst_Form_Long(msg); if (form.ShowDialog() == DialogResult.Yes) { insert_signin(dt.Rows[0]["employeeStart"].ToString().Trim()); } else { this.DialogResult = DialogResult.Cancel; this.Close(); } } }
public void get_Employee_Status(string rfid) { setup_Datatable setup = new setup_Datatable(); DataTable dt = setup.datatable_instructor_RFID(rfid); if (dt.Rows.Count == 0) { alertControl1.Show(this, "Data center", "Instructor not found", gbr_warn); return; } else { if (_employee_Start.Trim() == dt.Rows[0]["employeeStart"].ToString().Trim()) { timer1.Stop(); if (MessageBox.Show("Do you want to finish this private instruction session ?", "Axioma agent", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { update_Signin(); } else { this.DialogResult = DialogResult.Cancel; this.Close(); } } else { MessageBox.Show("Instructor does not match with instructor started the private instruction session", "Axioma Agent", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public void get_Employee_Status(string rfid) { setup_Datatable setup = new setup_Datatable(); DataTable dt = setup.datatable_instructor_RFID(rfid); if (dt.Rows.Count == 0) { alertControl1.Show(this, "Data center", "Instructor not found", gbr_warn); return; } else { timer1.Stop(); //cek registered package instructor with instructor finger List <string> list_instructorName = new List <string>(); foreach (DataRow data in _dt_listData.Rows) { if (data["instructorCode"].ToString().Trim() != dt.Rows[0]["employeeStart"].ToString().Trim()) { if (!list_instructorName.Contains(data["instructorName"].ToString().Trim())) { list_instructorName.Add(data["instructorName"].ToString().Trim()); } } } string msg = ""; if (list_instructorName.Count == 0) { msg = "Do you want to start using <b>" + _productName + "</b> private session with total participants <b>" + _totalParticipants + "</b>, teach by <b>" + dt.Rows[0]["preferredName"].ToString().Trim() + "</b> ?"; } else { msg = "<b>" + string.Join(";", list_instructorName.ToArray()) + "</b> is the registered instructor for this private instruction package. \nDo you want to start using <b>" + _productName + "</b> private session with total participants <b>" + _totalParticipants + "</b>, teach by <b>" + dt.Rows[0]["preferredName"].ToString().Trim() + "</b> ?"; } Cst_Form_Long form = new Cst_Form_Long(msg); if (form.ShowDialog() == DialogResult.Yes) { insert_signin(dt.Rows[0]["employeeStart"].ToString().Trim()); } else { this.DialogResult = DialogResult.Cancel; this.Close(); } } }