public void Delete(int id)
        {
            var wedding = _weddingBusiness.GetWedding(id);

            var couple      = wedding.Couple;
            var cerimony    = wedding.Cerimony;
            var party       = wedding.Party;
            var paymentPlan = wedding.PaymentPlan;

            _weddingBusiness.Delete(wedding.Id);

            if (couple != null)
            {
                _coupleServices.Delete(couple);
            }

            if (cerimony != null)
            {
                _addressServices.Delete(cerimony);
            }

            if (party != null)
            {
                _addressServices.Delete(party);
            }

            if (paymentPlan != null)
            {
                _paymentPlanServices.Delete(paymentPlan);
            }
        }
Ejemplo n.º 2
0
        // DELETE: api/Lookup/5
        public bool Delete(int id)
        {
            HttpRequestHeaders headers = Request.Headers;
            bool hardDelete            = false;

            if (headers.Contains("hard_delete"))
            {
                hardDelete = bool.Parse(headers.GetValues("hard_delete").First());
            }
            return(id > 0 && _addressServices.Delete(id, hardDelete));
        }
        public void Delete(Engaged engaged)
        {
            var address = engaged.MakingOf;

            Delete(engaged.Id);

            if (address != null)
            {
                _addressServices.Delete(address);
            }
        }
        public async Task <JsonResult> DeleteMunicipalities(int municipalitiesId)
        {
            var municipalityInfo = await _municipalitiesService.Get(new EntityDto(municipalitiesId));

            var idAddressDto = new EntityDto()
            {
                Id = municipalityInfo.AddressId
            };
            await _addressServices.Delete(idAddressDto);

            var idDto = new EntityDto()
            {
                Id = municipalitiesId
            };
            await _municipalitiesService.Delete(idDto);

            return(Json(new { reload = true }));
        }
Ejemplo n.º 5
0
 [HttpDelete("{id}")]// api/Address/5
 public void Delete(int id)
 {
     _addressServices.Delete(id);
 }