private void btn_save_Click(object sender, EventArgs e) { titleBoxItem tbi = (titleBoxItem)cbTitle.SelectedItem; //MessageBox.Show(tbi.Txt + " " + tbi.Val); hbys_winApp.hisLib hl = new hisLib(); string res; if (lblPersonalNo.Text == "0") { res = hl.addPersonalDatas(tbFName.Text, tbLName.Text, Int32.Parse(tbi.Val)); //val seçmiş oldupum titleın idsi anlamına geliyor. } else { res = hl.updatePersonalDatas(tbFName.Text, tbLName.Text, Int32.Parse(tbi.Val), Int32.Parse(lblPersonalNo.Text)); } if (res == "1") { MessageBox.Show("Successfully Saved", "Congratulation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Sorry an error has occured" + res, "Failed", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void addPersonalDatasForm_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); hbys_winApp.hisLib myObj = new hisLib(); ds = myObj.showTitleList(); cbTitle.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { titleBoxItem mbi = new titleBoxItem(); mbi.Txt = ds.Tables[0].Rows[i]["TitleName"].ToString(); mbi.Val = ds.Tables[0].Rows[i]["TitleNo"].ToString(); cbTitle.Items.Add(mbi); } if (cbTitle.Items.Count > 0) { cbTitle.SelectedIndex = 0; } /////////////////////////////////////////////////////////////// ds = myObj.showPersonalDatas(Int32.Parse(lblPersonalNo.Text)); tbFName.Text = ds.Tables[0].Rows[0]["Fname"].ToString(); tbLName.Text = ds.Tables[0].Rows[0]["Sname"].ToString(); string titleNo = ds.Tables[0].Rows[0]["TitleNo"].ToString(); for (int i = 0; i < cbTitle.Items.Count; i++) { if (((titleBoxItem)cbTitle.Items[i]).Val == titleNo) { cbTitle.SelectedIndex = i; break; } } }
private void addRecipeDatasForm_Load(object sender, EventArgs e) { DataSet drugDataSet = new DataSet(); hbys_winApp.hisLib drugHisLib = new hisLib(); drugDataSet = drugHisLib.DrugList(); comboDrug.Items.Clear(); for (int i = 0; i < drugDataSet.Tables[0].Rows.Count; i++) { titleBoxItem drugBoxItem = new titleBoxItem(); drugBoxItem.Txt = drugDataSet.Tables[0].Rows[i]["DrugName"].ToString(); drugBoxItem.Val = drugDataSet.Tables[0].Rows[i]["DrugNo"].ToString(); comboDrug.Items.Add(drugBoxItem); } if (comboDrug.Items.Count > 0) { comboDrug.SelectedItem = 0; } }
private void addDiagtoExam_Load(object sender, EventArgs e) { DataSet diagDataSet = new DataSet(); hbys_winApp.hisLib diagHisLib = new hisLib(); diagDataSet = diagHisLib.showDiagnosisList(); comboDiag.Items.Clear(); for (int i = 0; i < diagDataSet.Tables[0].Rows.Count; i++) { titleBoxItem diagBoxItem = new titleBoxItem(); diagBoxItem.Txt = diagDataSet.Tables[0].Rows[i]["Diagnosis Name"].ToString(); diagBoxItem.Val = diagDataSet.Tables[0].Rows[i]["Diagnosis No"].ToString(); comboDiag.Items.Add(diagBoxItem); } if (comboDiag.Items.Count > 0) { comboDiag.SelectedIndex = 0; } }
private void addSurvey2Exam_Load(object sender, EventArgs e) { DataSet surveyDataSet = new DataSet(); hbys_winApp.hisLib surveyHisLib = new hisLib(); surveyDataSet = surveyHisLib.showSurveyList(); comboSurvey.Items.Clear(); for (int i = 0; i < surveyDataSet.Tables[0].Rows.Count; i++) { titleBoxItem surveyBoxItem = new titleBoxItem(); surveyBoxItem.Txt = surveyDataSet.Tables[0].Rows[i]["SurveyName"].ToString(); surveyBoxItem.Val = surveyDataSet.Tables[0].Rows[i]["SurveyNo"].ToString(); comboSurvey.Items.Add(surveyBoxItem); } if (comboSurvey.Items.Count > 0) { comboSurvey.SelectedIndex = 0; } }
private void addSendingForm_Load(object sender, EventArgs e) { //----------------------------Patient Name in Combo Box-----------------------------------// if (lblSendingNo.Text == "0") { btnDel.Visible = false; } else { btnDel.Visible = true; } DataSet ds = new DataSet(); hbys_winApp.hisLib objectHisLib = new hisLib(); ds = objectHisLib.patientList(); comboBoxPatientName.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { titleBoxItem objectTitle = new titleBoxItem(); objectTitle.Txt = ds.Tables[0].Rows[i]["FName"].ToString() + " " + ds.Tables[0].Rows[i]["Sname"].ToString() + " " + ds.Tables[0].Rows[i]["TCNo"].ToString(); objectTitle.Val = ds.Tables[0].Rows[i]["PatientNo"].ToString(); comboBoxPatientName.Items.Add(objectTitle); } if (comboBoxPatientName.Items.Count > 0) { comboBoxPatientName.SelectedIndex = 0; } //----------------------------Patient Establishment in Combo Box-----------------------------------// ds = objectHisLib.showEstablishment(); comboBoxEstablishment.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { titleBoxItem establishmentObject = new titleBoxItem(); establishmentObject.Txt = ds.Tables[0].Rows[i]["EstablishmentName"].ToString(); establishmentObject.Val = ds.Tables[0].Rows[i]["EstablishmentNo"].ToString(); comboBoxEstablishment.Items.Add(establishmentObject); } if (comboBoxEstablishment.Items.Count > 0) { comboBoxEstablishment.SelectedIndex = 0; } //----------------------------Patient Establishment in Combo Box-----------------------------------// //----------------------------Update Seciton-------------------------------------------------------// if (lblSendingNo.Text != "0") { hbys_winApp.hisLib getData = new hisLib(); ds = getData.showSendingDatas(Int32.Parse(lblSendingNo.Text)); string examinationNo = ds.Tables[0].Rows[0]["PatientNo"].ToString(); string establishmentNo = ds.Tables[0].Rows[0]["EstablishmentNo"].ToString(); //------------------------------ for (int i = 0; i < comboBoxPatientName.Items.Count; i++) { if (((titleBoxItem)comboBoxPatientName.Items[i]).Val == examinationNo) { comboBoxPatientName.SelectedIndex = i; break; } } //------------------------------ for (int i = 0; i < comboBoxEstablishment.Items.Count; i++) { if (((titleBoxItem)comboBoxEstablishment.Items[i]).Val == establishmentNo) { comboBoxEstablishment.SelectedIndex = i; break; } } //----------------------------Update Section-------------------------------------------------------// } }
private void addExaminationDatas_Load(object sender, EventArgs e) { //------------------------------------------------ DataSet ds = new DataSet(); hbys_winApp.hisLib myObj = new hisLib(); ds = myObj.showPersonalDatas(0); comboPersonal.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { titleBoxItem mbi = new titleBoxItem(); mbi.Txt = ds.Tables[0].Rows[i]["Fname"].ToString() + " " + ds.Tables[0].Rows[i]["Sname"].ToString(); mbi.Val = ds.Tables[0].Rows[i]["PersonalNo"].ToString(); comboPersonal.Items.Add(mbi); } if (comboPersonal.Items.Count > 0) { comboPersonal.SelectedIndex = 0; } //------------------------------------------------ ds = myObj.showServiceNames(); comboService.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { titleBoxItem mbi = new titleBoxItem(); mbi.Txt = ds.Tables[0].Rows[i]["ServiceName"].ToString(); mbi.Val = ds.Tables[0].Rows[i]["ServiceNo"].ToString(); comboService.Items.Add(mbi); } if (comboService.Items.Count > 0) { comboService.SelectedIndex = 0; } //------------------------------------------------ ds = myObj.patientList(); comboPatient.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { titleBoxItem mbi = new titleBoxItem(); mbi.Txt = ds.Tables[0].Rows[i]["FName"].ToString() + " " + ds.Tables[0].Rows[i]["Sname"].ToString() + "(" + ds.Tables[0].Rows[i]["TCNo"].ToString() + ")"; mbi.Val = ds.Tables[0].Rows[i]["PatientNo"].ToString(); comboPatient.Items.Add(mbi); } if (comboPatient.Items.Count > 0) { comboPatient.SelectedIndex = 0; } //------------------------------------------------ if (lblExNo.Text != "0") { hbys_winApp.hisLib getData = new hisLib(); ds = getData.showExaminationDatas(Int32.Parse(lblExNo.Text)); string perNo = ds.Tables[0].Rows[0]["PersonalNo"].ToString(); string serNo = ds.Tables[0].Rows[0]["ServiceNo"].ToString(); string patNo = ds.Tables[0].Rows[0]["PatientNo"].ToString(); DateTime d = Convert.ToDateTime(ds.Tables[0].Rows[0]["ExaminationDate"].ToString()); //------------------------------ for (int i = 0; i < comboPatient.Items.Count; i++) { if (((titleBoxItem)comboPatient.Items[i]).Val == patNo) { comboPatient.SelectedIndex = i; break; } } //------------------------------ for (int i = 0; i < comboService.Items.Count; i++) { if (((titleBoxItem)comboService.Items[i]).Val == serNo) { comboService.SelectedIndex = i; break; } } //------------------------------ for (int i = 0; i < comboPersonal.Items.Count; i++) { if (((titleBoxItem)comboPersonal.Items[i]).Val == perNo) { comboPersonal.SelectedIndex = i; break; } } //------------------------------ dateExam.Value = d; //------------------------------ } }