private void butSubmitImmunization_Click(object sender, EventArgs e) { if (gridVaccine.SelectedIndices.Length == 0) { MessageBox.Show("Please select at least one vaccine."); return; } List <VaccinePat> vaccines = new List <VaccinePat>(); for (int i = 0; i < gridVaccine.SelectedIndices.Length; i++) { vaccines.Add(VaccineList[gridVaccine.SelectedIndices[i]]); } OpenDentBusiness.HL7.EhrVXU vxu = null; try { vxu = new OpenDentBusiness.HL7.EhrVXU(PatCur, vaccines); } catch (Exception ex) { //Exception happens when validation fails. MessageBox.Show(ex.Message); //Show validation error messages. return; } string outputStr = vxu.GenerateMessage(); Cursor = Cursors.WaitCursor; try { EmailMessages.SendTestUnsecure("Immunization Submission", "vxu.txt", outputStr); } catch (Exception ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message); return; } Cursor = Cursors.Default; MessageBox.Show("Sent"); }
private void butExport_Click(object sender, EventArgs e) { if (gridVaccine.SelectedIndices.Length == 0) { MessageBox.Show("Please select at least one vaccine."); return; } List <VaccinePat> vaccines = new List <VaccinePat>(); for (int i = 0; i < gridVaccine.SelectedIndices.Length; i++) { vaccines.Add(VaccineList[gridVaccine.SelectedIndices[i]]); } OpenDentBusiness.HL7.EhrVXU vxu = null; try { vxu = new OpenDentBusiness.HL7.EhrVXU(PatCur, vaccines); } catch (Exception ex) { //Exception happens when validation fails. MessageBox.Show(ex.Message); //Show validation error messages. return; } string outputStr = vxu.GenerateMessage(); SaveFileDialog dlg = new SaveFileDialog(); dlg.FileName = "vxu.txt"; DialogResult result = dlg.ShowDialog(); if (result != DialogResult.OK) { return; } if (File.Exists(dlg.FileName)) { if (MessageBox.Show("Overwrite existing file?", "", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } } File.WriteAllText(dlg.FileName, outputStr); MessageBox.Show("Saved"); }
private void butExport_Click(object sender,EventArgs e) { if(gridVaccine.SelectedIndices.Length==0) { MessageBox.Show("Please select at least one vaccine."); return; } List<VaccinePat> vaccines=new List<VaccinePat>(); for(int i=0;i<gridVaccine.SelectedIndices.Length;i++) { vaccines.Add(VaccineList[gridVaccine.SelectedIndices[i]]); } OpenDentBusiness.HL7.EhrVXU vxu=null; try { vxu=new OpenDentBusiness.HL7.EhrVXU(PatCur,vaccines); } catch(Exception ex) {//Exception happens when validation fails. MessageBox.Show(ex.Message);//Show validation error messages. return; } string outputStr=vxu.GenerateMessage(); SaveFileDialog dlg=new SaveFileDialog(); dlg.FileName="vxu.txt"; DialogResult result=dlg.ShowDialog(); if(result!=DialogResult.OK){ return; } if(File.Exists(dlg.FileName)) { if(MessageBox.Show("Overwrite existing file?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) { return; } } File.WriteAllText(dlg.FileName,outputStr); MessageBox.Show("Saved"); }
private void butSubmitImmunization_Click(object sender,EventArgs e) { if(gridVaccine.SelectedIndices.Length==0) { MessageBox.Show("Please select at least one vaccine."); return; } List<VaccinePat> vaccines=new List<VaccinePat>(); for(int i=0;i<gridVaccine.SelectedIndices.Length;i++) { vaccines.Add(VaccineList[gridVaccine.SelectedIndices[i]]); } OpenDentBusiness.HL7.EhrVXU vxu=null; try { vxu=new OpenDentBusiness.HL7.EhrVXU(PatCur,vaccines); } catch(Exception ex) {//Exception happens when validation fails. MessageBox.Show(ex.Message);//Show validation error messages. return; } string outputStr=vxu.GenerateMessage(); Cursor=Cursors.WaitCursor; try { EmailMessages.SendTestUnsecure("Immunization Submission","vxu.txt",outputStr); } catch(Exception ex) { Cursor=Cursors.Default; MessageBox.Show(ex.Message); return; } Cursor=Cursors.Default; MessageBox.Show("Sent"); }