Beispiel #1
0
 public Registro(int registry_Number, string book_Name, int book_Number, int pageNumber,
                 string registry_Date, string name, string sex, string birthDate, string birthHour,
                 string fatherName, string fatherBirthDate, string fatherBirthCity, string motherName,
                 string motherBirthDate, string motherBirthCity, string docmentNumber, int isOnDeadline)
 {
     Registry_Number = registry_Number;
     Book_Name       = book_Name;
     Book_Number     = book_Number;
     Page_Number     = pageNumber;
     Registry_Date   = DateTime.Parse(registry_Date);
     Name            = name;
     Sex             = Sex.MALE.value.Equals(sex) ? Sex.MALE : Sex.FEMALE;
     BirthDate       = DateTime.Parse(birthDate);
     BirthHour       = DateTime.Parse(birthHour);
     FatherName      = fatherName;
     FatherBirthDate = DateTime.Parse(fatherBirthDate);
     FatherAge       = BusinessLogicalLayer.IdadePai(FatherBirthDate);
     FatherBirthCity = fatherBirthCity;
     MotherName      = motherName;
     MotherBirthDate = DateTime.Parse(motherBirthDate);
     if (isOnDeadline == 1)
     {
         BusinessLogicalLayer.IdadeMae(MotherBirthDate, Registry_Date, isOnDeadline == 1 ? true : false);
     }
     MotherBirthCity = motherBirthCity;
     DocumentNumber  = docmentNumber;
     IsOnDeadline    = isOnDeadline.Equals(0) ? false : true;
 }
Beispiel #2
0
 private void DtpMotherBirthDate_LostFocus(object sender, RoutedEventArgs e)
 {
     try
     {
         lblMotherAge.Content = BusinessLogicalLayer.IdadeMae(dtpMotherBirthDate.SelectedDate.Value, dtpRegistryDate.SelectedDate.Value, ckbIsOnDeadline.IsChecked.Value);
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message, "Idade invalida", MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
 }
Beispiel #3
0
 private void DtpFatherBirthDate_LostFocus(object sender, RoutedEventArgs e)
 {
     try
     {
         lblFatherAge.Content = BusinessLogicalLayer.IdadePai(dtpFatherBirthDate.SelectedDate.Value);
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message, "Idade invalida", MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
 }
Beispiel #4
0
 private void TxtDocument_LostFocus(object sender, RoutedEventArgs e)
 {
     if (!txtDocument.Text.Equals(""))
     {
         if (cmbBook.SelectedItem.ToString().Equals("A"))
         {
             if (!BusinessLogicalLayer.DNVValidate(txtDocument.Text))
             {
                 MessageBox.Show("Numero de documento invalido, por favor verificar o numero digitado.", "Numero invalido", MessageBoxButton.OK, MessageBoxImage.Exclamation);
             }
         }
         else
         {
             if (!BusinessLogicalLayer.DOValidate(txtDocument.Text))
             {
                 MessageBox.Show("Numero de documento invalido, por favor verificar o numero digitado.", "Numero invalido", MessageBoxButton.OK, MessageBoxImage.Exclamation);
             }
         }
     }
 }