Beispiel #1
0
        private void medAddButton_Click(object sender, RoutedEventArgs e)
        {
            MedicalBillsTypeDTO dTO = new MedicalBillsTypeDTO();
            MedicalBillsDTO     med = new MedicalBillsDTO
            {
                Name = medNameTextBox.Text,
                //        Quantity = int.Parse(medQuantityTextBox.Text),
                //        ManufactureId = int.Parse(medManufacturerTextBox.Text),
                ////        MedicalBillsType = int.Parse(medTypeTextBox.Text),
                //        DateOfManufacture = (DateTime)medDateOfManufacturePicker.SelectedDate,
                //        ExpirationDate = (DateTime)medExpirationDatePicker.SelectedDate
            };
            MedicalBillsDTO elem = _medicalBillsService.GetAll().Last();

            dTO.Id               = elem.MedicalBillsType.Id;
            dTO.Type             = medTypeTextBox.Text;
            med.MedicalBillsType = dTO;
            medicalBills.Add(med);
            _medicalBillsService.Add(med);
            medicalBills[medicalBills.Count - 1].Id = elem.Id;
            medicalBillsDataGrid.Items.Refresh();
        }
Beispiel #2
0
 private void medUpdateButton_Click(object sender, RoutedEventArgs e)
 {
     if (medicalBillsDataGrid.SelectedItem != null)
     {
         MedicalBillsTypeDTO dTO      = new MedicalBillsTypeDTO();
         MedicalBillsDTO     selected = (MedicalBillsDTO)medicalBillsDataGrid.SelectedItem;
         MedicalBillsDTO     med      = new MedicalBillsDTO
         {
             //Name = medNameTextBox.Text,
             //Quantity = int.Parse(medQuantityTextBox.Text),
             //ManufactureId = int.Parse(medManufacturerTextBox.Text),
             //DateOfManufacture = (DateTime)medDateOfManufacturePicker.SelectedDate,
             //ExpirationDate = (DateTime)medExpirationDatePicker.SelectedDate
         };
         MedicalBillsDTO elem = _medicalBillsService.GetAll().Last();
         dTO.Id               = elem.MedicalBillsType.Id;
         dTO.Type             = medTypeTextBox.Text;
         med.MedicalBillsType = dTO;
         med.Id               = medicalBills[medicalBills.IndexOf(selected)].Id;
         medicalBills[medicalBills.IndexOf(selected)] = med;
         _medicalBillsService.Update(med);
         medicalBillsDataGrid.Items.Refresh();
     }
 }
 public void Update(MedicalBillsTypeDTO entity)
 {
     _repository.Update(Mapper.FromDTO(entity));
 }
 public void Remove(MedicalBillsTypeDTO entity)
 {
     _repository.Remove(Mapper.FromDTO(entity));
 }
 public void Add(MedicalBillsTypeDTO entity)
 {
     _repository.Add(Mapper.FromDTO(entity));
 }