public Visit Add(Visit objVisit) { Client objClient = _clientBl.Get(objVisit.ClientId ?? default(int)); objClient.AvailableCredit -= 1; objClient.VisitsPercentage = objClient.AvailableCredit / objClient.CreditLimit; objVisit.Net = objClient.CreditLimit - objClient.AvailableCredit; objVisit.VisitTotal = objVisit.Net * objClient.VisitsPercentage; _clientBl.Update(objClient); return(_visitRepository.Add(objVisit)); }
public void Update(Client value) { _clientBl.Update(value); }