예제 #1
0
 private void AdmitPatient()
 {
     try
     {
         using (WaitCursor wc = new WaitCursor())
         {
             Patient patient           = new Patient();
             PatientAdmissionForm form = new PatientAdmissionForm(patient);
             form.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }
        private void Open()
        {
            try
            {
                using (WaitCursor wc = new WaitCursor())
                {
                    Patient patient = SelectedPatient;
                    if (patient != null)
                    {
                        PatientAdmissionForm form = new PatientAdmissionForm(patient);
                        int wardId = patient.wardId;
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            DataRow dr = SelectedRow;
                            if (dr != null)
                            {
                                dr["AdmissionDate"] = patient.admissionDate;
//                                dr["DischargeDate"] = patient.dischargeDate == DateTime.MinValue ? DBNull.Value : (object)patient.dischargeDate;
                                string   ward;
                                Passport passport;
                                using (GmConnection conn = App.CreateConnection())
                                {
                                    ward     = patient.GetWardNumber(conn);
                                    passport = patient.GetPassport(conn);
                                }
                                if (ward != null)
                                {
                                    dr["WardNumber"] = ward;
                                }
                                if (passport != null)
                                {
                                    dr["Name"]       = passport.name;
                                    dr["MiddleName"] = passport.middleName;
                                    dr["Surname"]    = passport.surname;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }