Ejemplo n.º 1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (tpt_id == null)
     {
         MessageBox.Show("Please Select Patient.");
         txtPatientName.Focus();
     }
     else if (mut_id == null)
     {
         MessageBox.Show("Please Select Doctor.");
         txtDoctor.Focus();
     }
     else
     {
         DateTime dateNow = Program.GetServerDateTime();
         trn_report_aviation_medical tram = (trn_report_aviation_medical)bsAviaMedCer.Current;
         tram.mut_id                  = mut_id;
         tram.tram_date_print         = dateTimePicker1.Value.Date;
         tram.tram_date_exam          = dateTimePicker2.Value.Date;
         tram.tram_purpose_physical   = Program.GetValueRadioTochar(pnPurpose);
         tram.tram_assessment_aircrew = Program.GetValueRadio(pnAirMedCer);
         tram.tram_assessment_as      = Program.GetValueRadio(pnAS);
         tram.tram_ass_as_remark      = txtAsRemark.Text;
         tram.tram_update_by          = Program.CurrentUser.mut_username;
         tram.tram_update_date        = dateNow;
         trn_patient tpt = cdc.trn_patients.Where(x => x.tpt_id == tpt_id).FirstOrDefault();
         if (tram.tram_id == 0)
         {
             tram.tram_create_by   = Program.CurrentUser.mut_username;
             tram.tram_create_date = dateNow;
             tpt.trn_report_aviation_medicals.Add(tram);
         }
         else
         {
             bsAviaMedCer.EndEdit();
         }
         cdc.SubmitChanges();
         tram_id          = tram.tram_id;
         btnPrint.Enabled = true;
     }
 }
Ejemplo n.º 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            trn_report_aviation_medical tram = (trn_report_aviation_medical)bsAviaMedCer.Current;

            Report.frmPreviewReport frm = new Report.frmPreviewReport(tram.tram_id, "AV103", Program.CurrentSite.mhs_ename);
        }