Das endgültige Löschen von Klienten ist jetzt implementiert.
This commit is contained in:
@@ -5190,46 +5190,50 @@ namespace BeWo.Service.ServiceImplementations
|
||||
private int _AbWelchemKrankheitsTag;
|
||||
private bool _VertretungDringendErforderlich;
|
||||
*/
|
||||
|
||||
|
||||
//var appointments = DAOFactory.SearchDAO.FindAppointmentsForCustomer(pCustomerOid);
|
||||
//var customer = DAOFactory.GenericDAO.LoadByID<Customer>(pCustomerOid);
|
||||
|
||||
//appointments.DoForEach(app => app.CustomerList.Remove(customer));
|
||||
|
||||
var appointments = DAOFactory.SearchDAO.FindAppointmentsForCustomer(pCustomerOid);
|
||||
var customer = DAOFactory.GenericDAO.LoadByID<Customer>(pCustomerOid);
|
||||
|
||||
appointments.DoForEach(app => app.CustomerList.Remove(customer));
|
||||
|
||||
DAOFactory.GenericDAO.Update(appointments);
|
||||
|
||||
var costBearer2SupportConcepts = new List<CostBearer2SupportConcept>();
|
||||
var groupsToGetReferencesRemoved = new List<GroupOfPeople>();
|
||||
foreach(var sc in customer.SupportConcepts)
|
||||
{
|
||||
foreach(var cb2sc in sc.CostBearer2SupportConceptList)
|
||||
{
|
||||
groupsToGetReferencesRemoved.AddRangeIfElementsNotIn(DAOFactory.SearchDAO.GroupOfPeopleForSupportConcept(cb2sc.Oid.Value));
|
||||
costBearer2SupportConcepts.AddIfNotIn(cb2sc);
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var group in groupsToGetReferencesRemoved)
|
||||
{
|
||||
group.CostBearer2SupportConceptList.RemoveRange(costBearer2SupportConcepts);
|
||||
}
|
||||
|
||||
DAOFactory.GenericDAO.Update(groupsToGetReferencesRemoved);
|
||||
|
||||
DAOFactory.GenericDAO.Update(customer.SupportConcepts);
|
||||
|
||||
customer.SupportConcepts.DoForEach(s => s.CostBearer2SupportConceptList?.Clear());
|
||||
foreach(var assessmentSheetCategory in customer.AssessmentSheetCategoryList)
|
||||
{
|
||||
assessmentSheetCategory.Customers.Remove(customer);
|
||||
}
|
||||
|
||||
var assessmentSheetEntries = DAOFactory.SearchDAO.GetAssessmentSheetEntriesForCustomer(customer.Oid.Value, DateTime.MinValue, DateTime.MaxValue);
|
||||
|
||||
//DAOFactory.GenericDAO.Update(appointments);
|
||||
|
||||
//var costBearer2SupportConcepts = new List<CostBearer2SupportConcept>();
|
||||
//var groupsToGetReferencesRemoved = new List<GroupOfPeople>();
|
||||
//foreach(var sc in customer.SupportConcepts)
|
||||
//{
|
||||
// foreach(var cb2sc in sc.CostBearer2SupportConceptList)
|
||||
// {
|
||||
// groupsToGetReferencesRemoved.AddRangeIfElementsNotIn(DAOFactory.SearchDAO.GroupOfPeopleForSupportConcept(cb2sc.Oid.Value));
|
||||
// costBearer2SupportConcepts.AddIfNotIn(cb2sc);
|
||||
// }
|
||||
//}
|
||||
|
||||
//foreach(var group in groupsToGetReferencesRemoved)
|
||||
//{
|
||||
// group.CostBearer2SupportConceptList.RemoveRange(costBearer2SupportConcepts);
|
||||
//}
|
||||
DAOFactory.GenericDAO.Delete(assessmentSheetEntries);
|
||||
|
||||
//DAOFactory.GenericDAO.Update(groupsToGetReferencesRemoved);
|
||||
|
||||
//DAOFactory.GenericDAO.Update(customer.SupportConcepts);
|
||||
DAOFactory.GenericDAO.Update(customer);
|
||||
|
||||
//customer.SupportConcepts.DoForEach(s => s.CostBearer2SupportConceptList?.Clear());
|
||||
//foreach(var assessmentSheetCategory in customer.AssessmentSheetCategoryList)
|
||||
//{
|
||||
|
||||
//}
|
||||
DAOFactory.GenericDAO.Delete(customer.SupportConcepts);
|
||||
|
||||
//DAOFactory.GenericDAO.Update(customer);
|
||||
|
||||
//DAOFactory.GenericDAO.Delete(customer.SupportConcepts);
|
||||
|
||||
//DAOFactory.GenericDAO.Delete(customer);
|
||||
DAOFactory.GenericDAO.Delete(DAOFactory.GenericDAO.LoadByID<Customer>(customer.Oid.Value));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user