private void Timecheck(MaskedTextBox txt, KeyEventArgs e) { if (e.KeyCode == Keys.Back || e.KeyCode == Keys.Enter || e.KeyCode == Keys.Delete) { return; } string[] timekey = txt.Text.ToString().Split(':'); int time1Houre = Convert1.ToInt32(timekey[0].Trim()); if (timekey[0].Trim().Length == 2) { if (time1Houre > 23) { time1Houre = 23; txt.Text = time1Houre.ToString() + ":" + timekey[1]; } } int time2Houre = Convert1.ToInt32(timekey[1].Trim()); if (timekey[1].Trim().Length == 2) { if (time2Houre > 59) { time2Houre = 59; txt.Text = time1Houre.ToString("00") + ":" + time2Houre.ToString(); } } }
private void btnSearchReport_Click(object sender, EventArgs e) { int mhs_id = Convert1.ToInt32(DDsite.SelectedValue); int mrm_id = Convert1.ToInt32(DDStation.SelectedValue); ShowReport(mhs_id, mrm_id); }
private void GV_Null_Result_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { dbc.Connection.Close(); dbc = new InhCheckupDataContext(); Clearfrm(); SetTprID = Convert1.ToInt32(GV_Null_Result["Coltprid", e.RowIndex].Value); SetEN = Convert1.ToString(GV_Null_Result["EN", e.RowIndex].Value); CurrentRegis = (from t1 in dbc.trn_patient_regis where t1.tpr_id == SetTprID select t1).FirstOrDefault(); Program.CurrentRegis = CurrentRegis; if (CurrentRegis != null) { UIProfileHorizontal1.Loaddata(SetTprID, Program.CurrentSite.mhs_id); //new code// this.subjectiveUC1.PatientRegis = CurrentRegis; this.objectiveUC1.PatientRegis = CurrentRegis; this.tabAssessmentAndPlanUC1.PatientRegis = CurrentRegis; if (tabControl1.SelectedTab.Tag.ToString() != "1") { tabControl1.SelectedIndex = 0; } btnSaveDraft.Enabled = true; btnSendAuto.Enabled = true; } } }
private void GvHealthSelect_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { try { var selectedItems = GvHealthSelect.CurrentRow; SelectedID = Convert1.ToInt32(GvHealthSelect.Rows[e.RowIndex].Cells[0].Value); strSelectedName = GvHealthSelect.Rows[e.RowIndex].Cells[1].Value.ToString(); this.Close(); } catch { return; } }
private int GetPort() { using (InhCheckupDataContext dbc = new InhCheckupDataContext()) { int objip = Convert1.ToInt32((from mfh in dbc.mst_config_hdrs join mfd in dbc.mst_config_dtls on mfh.mfh_id equals mfd.mfh_id where mfh.mfh_code == "PUD" && mfh.mhs_id == Program.CurrentSite.mhs_id && mfh.mfh_status == 'A' && mfh.mfh_effective_date.Value.Date <= DateTime.Now.Date && (mfh.mfh_expire_date == null ? DateTime.Now.Date : mfh.mfh_expire_date.Value.Date) >= DateTime.Now.Date && mfd.mfd_status == 'A' && mfd.mfd_effective_date.Value.Date <= DateTime.Now.Date && (mfd.mfd_expire_date == null ? DateTime.Now.Date : mfd.mfd_expire_date.Value.Date) >= DateTime.Now.Date select mfd.mfd_text).FirstOrDefault()); return(objip); } }
private void SetUIProfileHorizontal1() { if (GV_Null_Result.RowCount > 0) { SetTprID = Convert1.ToInt32(GV_Null_Result["Coltprid", 0].Value); SetEN = Convert1.ToString(GV_Null_Result["EN", 0].Value); CurrentRegis = (from t1 in dbc.trn_patient_regis where t1.tpr_id == SetTprID select t1).FirstOrDefault(); if (CurrentRegis != null) { UIProfileHorizontal1.Loaddata(SetTprID, Program.CurrentSite.mhs_id); //this.LoadData(); this.subjectiveUC1.PatientRegis = CurrentRegis; this.objectiveUC1.PatientRegis = CurrentRegis; this.tabAssessmentAndPlanUC1.PatientRegis = CurrentRegis; } } }
private void DDsite_SelectedValueChanged(object sender, EventArgs e) { /* * select mrm.mrm_id, * mrm.mrm_ename * from mst_room_hdr mrm * where mrm.mhs_id = 1 * and mrm.mrm_status = 'A' * and CONVERT(date,GETDATE(),103) between * CONVERT(date,isnull(mrm.mrm_effective_date,getdate()),103) and * CONVERT(date,isnull(mrm.mrm_expire_date,getdate()),103); */ int msh_id = Convert1.ToInt32(DDsite.SelectedValue); var datenow = Program.GetServerDateTime().Date; List <mst_room_hdr> objRoom = (from t1 in dbc.mst_room_hdrs where t1.mrm_status == 'A' && (t1.mrm_effective_date == null || (t1.mrm_effective_date.Value.Date <= datenow && (t1.mrm_expire_date == null || t1.mrm_expire_date.Value.Date >= datenow) ) ) select t1).ToList(); if (msh_id > 0) { objRoom = objRoom.Where(x => x.mhs_id == msh_id).ToList(); } mst_room_hdr roomselect = new mst_room_hdr(); roomselect.mrm_id = 0; roomselect.mrm_ename = "Select All"; objRoom.Add(roomselect); DDStation.DataSource = objRoom.OrderBy(x => x.mhs_id).ToList(); DDStation.DisplayMember = "mrm_ename"; DDStation.ValueMember = "mrm_id"; if (msh_id == 0) { DDStation.SelectedValue = 0; } }
private void DDsiteToSend_SelectedValueChanged(object sender, EventArgs e) { if (siteid != Convert1.ToInt32(DDsiteToSend.SelectedValue)) { siteid = Convert1.ToInt32(DDsiteToSend.SelectedValue); try { int? mvt_id = Program.CurrentPatient_queue.mvt_id; string mvt_code = dbc.mst_events.Where(x => x.mvt_id == mvt_id).Select(x => x.mvt_code).FirstOrDefault(); int? mrm_id = Program.CurrentPatient_queue.mrm_id; string mrm_code = dbc.mst_room_hdrs.Where(x => x.mrm_id == mrm_id).Select(x => x.mrm_code).FirstOrDefault(); // Add Button in Gridview var objview = (from t1 in dbc.vw_patient_rooms where t1.mhs_id == siteid && t1.tpr_id == Program.CurrentRegis.tpr_id && (mrm_code == "CB" ? true : t1.mvt_code != mvt_code) select new ChoiceRoomGrid { mvt_id = t1.mvt_id, mhs_ename = t1.mhs_ename, mze_ename = t1.mze_ename, mrm_ename = t1.mrm_ename, mrm_id = t1.mrm_id, mrm_code = t1.mrm_code, mvt_code = t1.mvt_code, waiting_person = t1.waiting_person, waiting_time = t1.waiting_time, vip = t1.patient_vip }); dataGridView2.DataSource = new SortableBindingList <ChoiceRoomGrid>(objview.ToList()); } catch (Exception ex) { Program.MessageError("frmChoiceRoom", "DDsiteToSend_SelectedValueChanged", ex, false); } } }
private void selectedRoom() { DataGridViewRow row = dataGridView2.CurrentRow; int select_mrm_id = Convert.ToInt32(row.Cells["colRoomid"].Value.ToString()); //if (new EmrClass.GetDataMasterCls().GetMstRoomHdr((int)select_mrm_id).mrm_code == "DC") //{ //new Class.FunctionDataCls().stampPEDoctor(Program.CurrentRegis.tpr_id); //} int select_mvt_id = Convert.ToInt32(row.Cells["colmvtid"].Value.ToString()); int select_waiting_time = Convert1.ToInt32(row.Cells["ColWaitingTime"].Value); if (ProcessSelectRoom(select_mvt_id, select_mrm_id, select_waiting_time)) { select_mrmID = select_mrm_id; mvtID = select_mvt_id; WaitingTime = select_waiting_time; this.DialogResult = DialogResult.OK; } else { //this.DialogResult = DialogResult.Cancel; } }
private void GridReportResult_CellClick(object sender, DataGridViewCellEventArgs e) { lbMsgAlert.Text = ""; if (e.RowIndex != -1) { int toc_id = Convert1.ToInt32(GridReportResult["Coltoc_id", e.RowIndex].Value); string HNno = GridReportResult["ColHN2", e.RowIndex].Value.ToString(); currentObste = (from t1 in dbc.trn_obstetric_chiefs where t1.toc_id == toc_id orderby t1.tpr_id descending select t1).FirstOrDefault(); var objcurrentRegis = (from t1 in dbc.trn_obstetric_chiefs where t1.toc_id == toc_id orderby t1.tpr_id descending select new { HN = t1.trn_patient_regi.trn_patient.tpt_hn_no, EN = t1.trn_patient_regi.tpr_en_no, FullName = t1.trn_patient_regi.trn_patient.tpt_othername, Arrivedate = t1.trn_patient_regi.tpr_arrive_date, CheckDocName = t1.toc_doc_name }).FirstOrDefault(); if (objcurrentRegis != null) { txtHNno.Text = HNno; txtENno.Text = objcurrentRegis.EN; txtName.Text = objcurrentRegis.FullName; txtArriveDate.Text = objcurrentRegis.Arrivedate.Value.ToString("dd/MM/yyyy"); txtDoctorCheck.Text = objcurrentRegis.CheckDocName; ch_ResultAlert.Enabled = true; DateTimeAlert.Enabled = true; txtRemark.Enabled = true; } } }
private void btnRebister_Click(object sender, EventArgs e) { frmBGScreen frmbg = new frmBGScreen(); frmbg.Show(); Application.DoEvents(); //Avation Type Value label18.ForeColor = Color.Black; if (Program.GetValueRadioTochar(GBPatienttype) == '2' || Program.GetValueRadioTochar(GBPatienttype) == '4') { var AvationtypeValue = Program.GetValueRadioTochar(GBAviationType); if (AvationtypeValue == null || CBAviationCategory.SelectedValue == null) { if (CBAviationCategory.SelectedValue == null) { lbAlertMsg.Text = "Avation Category must have value!"; } if (AvationtypeValue == null) { lbAlertMsg.Text = "Avation type must have value!"; } lbAlertMsg.Focus(); label18.ForeColor = Color.Red; frmbg.Close(); return; } } //check NEO Time Correct TimeSpan interval; bool isconvert = true; try { interval = TimeSpan.Parse(txtnpotimeRemark.Text.Trim()); } catch (FormatException) { isconvert = true; } catch (OverflowException) { isconvert = false; } if (RDnpotimeYes.Checked && (txtnpotimeRemark.Text.Trim().Length < 5 || isconvert == false)) { lbAlertMsg.Text = "NPO Time incorrect."; lbAlertMsg.Focus(); frmbg.Close(); return; } //Save Data try { Boolean saveIsCompleted = false; dbc.Connection.Open(); DbTransaction trans = dbc.Connection.BeginTransaction(); dbc.Transaction = trans; DateTime datenowvalue = Program.GetServerDateTime(); var objregis = (tmp_patient_regi)this.TmpPatientRegisBindingSource.Current; objregis.hn_no = HNno; objregis.appoint_date = AppointDate;//รับค่าจากปุ่มที่กดตอนเปิดหน้าจอ objregis.status = 'N'; if (CBAviationCategory.Enabled == true && CBAviationCategory.SelectedValue != null) { objregis.mac_id = Program.GetValueComboBoxInt(CBAviationCategory); } else { objregis.mac_id = null; } if (CBDoctorCategory.Enabled == true && CBDoctorCategory.SelectedValue != null) { objregis.mdc_id = Program.GetValueComboBoxInt(CBDoctorCategory); } else { objregis.mdc_id = null; } if (CBHealthCheckUPProgram.SelectedValue != null) { objregis.mhc_id = Convert1.ToInt32(CBHealthCheckUPProgram.SelectedValue); } else { objregis.mhc_id = null; } objregis.patient_type = Program.GetValueRadioTochar(GBPatienttype); objregis.req_pe_bef_chkup = Program.GetValueRadioTochar(GBRequestPEBefore); objregis.req_doctor = Program.GetValueRadioTochar(GBRequestPE); if (objregis.req_doctor == 'N') { objregis.req_doc_gender = null; objregis.req_inorout_doctor = string.Empty; objregis.req_doc_code = string.Empty; objregis.req_doc_name = string.Empty; } else { objregis.req_doc_gender = Program.GetValueRadioTochar(GBDoctorGender); objregis.req_inorout_doctor = Program.GetValueRadio(GBRequestDoctor); } if (RDPatientType_Aviation.Checked || RDPatientType_AviationAircrew.Checked) {//ถ้าเลือกAViation ค่อย Save objregis.aviation_type = Program.GetValueRadioTochar(GBAviationType); } objregis.pe_type = Program.GetValueRadioTochar(GBPEType); objregis.npo_time = Program.GetValueRadioTochar(GBNPOTime); objregis.send_book = Program.GetValueRadioTochar(GBBook); objregis.send_to = Program.GetValueRadioTochar(panelBookSendTo); objregis.vip_hpc = (chkviphpc.Checked) ? true : false;//Added.Akkaradech on 2013-12-24{viphpc} try { tmpoutdepartmentsBindingSource.EndEdit(); TmpPatientRegisBindingSource.EndEdit(); dbc.SubmitChanges(); dbc.Transaction.Commit(); saveIsCompleted = true; Iscompleted = true; } catch (Exception ex) { dbc.Transaction.Rollback(); Program.MessageError(this.Name, "btnRebister_Click", ex, false); } finally { dbc.Connection.Close(); } if (saveIsCompleted == true) { lbAlertMsg.Text = "Save data completed."; lbAlertMsg.Focus(); } } catch (Exception ex) { Program.MessageError(this.Name, "btnRebister_Click", ex, false); } //ปิดหน้าจอมืดๆๆ frmbg.Close(); }
private void frmChoiceRoom_Load(object sender, EventArgs e) { var objsite = (from t1 in dbc.mst_hpc_sites where t1.mhs_status == 'A' && t1.mhs_room_chkup == true select new DropdownData { Code = t1.mhs_id, Name = t1.mhs_ename }).ToList(); DDsiteToSend.DataSource = objsite; DDsiteToSend.DisplayMember = "Name"; DDsiteToSend.ValueMember = "Code"; if (Program.CheckPointBSiteUse == 0) { DDsiteToSend.SelectedValue = Program.CurrentSite.mhs_id; } else { DDsiteToSend.SelectedValue = Program.CheckPointBSiteUse; //Program.CurrentSite.mhs_id; } int SendtoSiteId = 0; if (Program.CheckPointBSiteUse != 0) { SendtoSiteId = Program.CheckPointBSiteUse; } else { SendtoSiteId = Program.CurrentSite.mhs_id; } this.Text = Program.GetRoomName(); int? mvt_id = Program.CurrentPatient_queue.mvt_id; string mvt_code = dbc.mst_events.Where(x => x.mvt_id == mvt_id).Select(x => x.mvt_code).FirstOrDefault(); int? mrm_id = Program.CurrentPatient_queue.mrm_id; string mrm_code = dbc.mst_room_hdrs.Where(x => x.mrm_id == mrm_id).Select(x => x.mrm_code).FirstOrDefault(); // Add Button in Gridview var objview = (from t1 in dbc.vw_patient_rooms where t1.mhs_id == SendtoSiteId && t1.tpr_id == Program.CurrentRegis.tpr_id //&& (mrm_code == "CB" ? true : (mrm_code == "TE") ? true : t1.mrm_code != mrm_code) && (mrm_code == "CB" ? true : mrm_code == "US" ? t1.mrm_code != mrm_code : t1.mvt_code != mvt_code) select t1) .OrderBy(x => x.mhs_id) .ThenBy(x => x.mze_code) .ThenBy(x => x.mrm_seq_room) .Select(t1 => new ChoiceRoomGrid { mvt_id = t1.mvt_id, mrm_id = t1.mrm_id, mrm_code = t1.mrm_code, mhs_ename = t1.mhs_ename, mze_ename = t1.mze_ename, mrm_ename = t1.mrm_ename, waiting_person = t1.waiting_person_show, waiting_time = t1.waiting_time, mvt_code = t1.mvt_code, vip = t1.patient_vip }).ToList(); dataGridView2.DataSource = new SortableBindingList <ChoiceRoomGrid>(objview.ToList()); if (objview.Count() > 0) { select_mrmID = Convert.ToInt32(dataGridView2["colRoomid", 0].Value); mvtID = Convert.ToInt32(dataGridView2["colmvtid", 0].Value); WaitingTime = Convert1.ToInt32(dataGridView2["ColWaitingTime", 0].Value); } if (Program.CurrentSite.mhs_extra_pe_type != true) { dataGridView2.Columns["colVIP"].Visible = false; dataGridView2.Width = dataGridView2.Width - dataGridView2.Columns["colVIP"].Width; this.Width = this.Width - dataGridView2.Columns["colVIP"].Width; } }