コード例 #1
0
 public void visitToXml(Visit newVisit, string visitId)
 {
     XmlSerializer xmlWriter = new XmlSerializer(typeof(Visit));
     var path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + string.Format("//Visit{0}.xml", visitId);
     FileStream file = File.Create(path);
     xmlWriter.Serialize(file, newVisit);
     file.Close();
 }
コード例 #2
0
 public void visitToXmlDeleteOld(Visit newVisit, string visitId)
 {
     XmlSerializer xmlWriter = new XmlSerializer(typeof(Visit));
     var path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + string.Format("//Visit{0}.xml", visitId);
     FileStream file = File.Create(path);
     xmlWriter.Serialize(file, newVisit);
     file.Close();
     string[] paths;
     List<string> results = new List<string>();
     var newPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
     paths = Directory.GetFiles(newPath);
     foreach (string s in paths)
     {
         if (s.Contains(visitId.Replace("closed", "open")))
         {
             File.Delete(s);
         }
     }
 }
コード例 #3
0
 private void ultraBtnVRefresh_Click(object sender, EventArgs e)
 {
     ultraTextSearch.Text      = "";
     ultraDateTimeSearch.Value = "";
     try
     {
         objHospitalDB = new HospitalDB();
         Visit     objVisit = new Visit(objHospitalDB);
         DataTable dtVisit  = new DataTable();
         dtVisit = objVisit.GetAllAsDataTable();
         ultraGridVisit.DataSource = dtVisit;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         if (objHospitalDB != null)
         {
             objHospitalDB.Dispose();
         }
     }
 }
コード例 #4
0
        private void Sch_Apt_Click(object sender, RoutedEventArgs e)
        {
            googleCalendar.pushEvent(apt);
            doctorChoice = Doctor.SelectedValue.ToString();
            doctorChoice = doctorChoice.Remove(0, 38);
            Patient p = new Patient();
            Doctor d = new Doctor();
            p.Name = apt.Summary;
            d.Name = doctorChoice;
            Appointment appointment = new Appointment();
            appointment.Room = apt.Location;
            appointment.Description = apt.Description;
            appointment.Start = apt.Start.DateTime;
            appointment.End = apt.End.DateTime;
            appointment.Status = "open";
            Visit v = new Visit();
            v.apt = appointment;
            v.doc = d;
            v.patient = p;
            path = database.pathFormater(p.Name, d.Name, appointment);
            database.visitToXml(v, path);

        }
コード例 #5
0
        private void ultraBtnSave_Click(object sender, EventArgs e)
        {
            objHospitalDB = new HospitalDB();
            Visit    objVisit    = new Visit(objHospitalDB);
            VisitRow objVisitRow = new VisitRow();

            objVisitRow.DateOfDischarge = Convert.ToDateTime(ultraCalendarComboDOD.Text);
            objVisitRow.DateOfVisit     = Convert.ToDateTime(ultraCalendarComboDOV.Text);
            objVisitRow.Disease         = ultraTextDisease.Text;
            objVisitRow.Symptoms        = ultraTextSymtoms.Text;
            objVisitRow.Treatment       = ultraTextTreatment.Text;
            objVisitRow.DoctorID        = Convert.ToInt32(ultraComboEditorDoctorID.Text);
            objVisitRow.BedID           = Convert.ToInt32(ultraComboBedID.Text);
            objVisitRow.PatientID       = Convert.ToInt32(ultraComboEditorPatientID.Text);
            if (strFormMode == "NEW")
            {
                try
                {
                    if (radioBtnInPatient.Checked == true)
                    {
                        objVisitRow.PatientType = radioBtnInPatient.Text;
                        objVisit.Insert(objVisitRow);
                    }
                    else if (radioBtnOutPatient.Checked == true)
                    {
                        objVisitRow.PatientType = radioBtnOutPatient.Text;
                        objVisit.Insert(objVisitRow);

                        //query = objHospitalDB.CreateCommand("insert into Visit(PatientType,PatientName,PatientID,BedID,DoctorID,DateOfVisit,DateOfDischarge,Symptoms,Disease,Treatment) Values('" + c + "','" + ultraComboEditorPName.Text + "','" + ultraComboEditorPatientID.Text + "','" + ultraComboBedID.Text + "','" + ultraComboEditorDoctorID.Text + "','" + ultraCalendarComboDOV.Text + "','" + ultraCalendarComboDOV.Text + "','" + ultraTextSymtoms.Text + "','" + ultraTextDisease.Text + "','" + ultraTextTreatment.Text + "')", false);
                    }
                    else
                    {
                        objVisit.Insert(objVisitRow);

                        // query = objHospitalDB.CreateCommand("insert into Visit(PatientName,PatientID,DoctorID,BedID,DateOfVisit,DateOfDischarge,Symptoms,Disease,Treatment) Values('" + ultraComboEditorPName.Text + "','" + ultraComboEditorPatientID.Text + "','" + ultraComboEditorDoctorID.Text + "','" + ultraComboBedID.Text + "','" + ultraCalendarComboDOV.Text + "','" + ultraCalendarComboDOD.Text + "','" + ultraTextSymtoms.Text + "','" + ultraTextDisease.Text + "','" + ultraTextTreatment.Text + "')", false);
                    }
                    this.Hide();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                try
                {
                    if (radioBtnInPatient.Checked == true)

                    {
                        objVisitRow.PatientType = radioBtnInPatient.Text;
                        objVisitRow.VisitorID   = Convert.ToInt32(this.id);
                        objVisit.Update(objVisitRow);
                    }
                    else if (radioBtnOutPatient.Checked == true)
                    {
                        objVisitRow.PatientType = radioBtnOutPatient.Text;
                        objVisitRow.VisitorID   = Convert.ToInt32(this.id);
                        objVisit.Update(objVisitRow);
                    }
                    else
                    {
                        objVisitRow.VisitorID = Convert.ToInt32(this.id);
                        objVisit.Update(objVisitRow);
                    }
                    this.Hide();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    if (objHospitalDB != null)
                    {
                        objHospitalDB.Dispose();
                    }
                }
            }
        }