Esempio n. 1
0
 private void NewBarItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(FatherNameTE.Text) && !string.IsNullOrWhiteSpace(MotherNameTE.Text) &&
         !string.IsNullOrWhiteSpace(AddressTE.Text) && !string.IsNullOrWhiteSpace(PhoneTE.Text) &&
         !string.IsNullOrWhiteSpace(MobileTE.Text) && !string.IsNullOrWhiteSpace(UCIDTE.Text) && PatientLE.EditValue.ToString() != null)
     {
         patientInfo                     = new PatientInfo();
         patientInfo.Father_name         = FatherNameTE.Text;
         patientInfo.Mother_name         = MotherNameTE.Text;
         patientInfo.Address             = AddressTE.Text;
         patientInfo.Phone               = PhoneTE.Text;
         patientInfo.Mobile              = MobileTE.Text;
         patientInfo.UCID                = UCIDTE.Text;
         patientInfo.Relationship_status = RelationshipStatusCB.Checked;
         patientInfo.Smoker              = SmokerCE.Checked;
         patientInfo.Patient             = int.Parse(PatientLE.EditValue.ToString());
         if (!_DB.InsertPatientInfo(patientInfo))
         {
             XtraMessageBox.Show("Element is not added!");
         }
         _patientInfo = _DB.GetPatientInfo();
         PatientInfoGridControl.DataSource = _patientInfo;
     }
     else
     {
         XtraMessageBox.Show("All fields should be filled!");
     }
 }