Exemplo n.º 1
0
 public Fine Get(Guid Id)
 {
     return(UsingUnitOfWork(unitOfWork =>
     {
         FineEntity Fine = unitOfWork.Fines.Get(Id);
         return new Fine(Fine);
     }));
 }
Exemplo n.º 2
0
 public Fine(FineEntity Fine)
 {
     Id           = Fine.Id;
     DueAmount    = Fine.dueAmount;
     VehicleVin   = Fine.vehicleVin;
     FineResource = Fine.fineResource;
     Vehicle      = new Vehicle(Fine.finedVehicle);
     Debtor       = new Person(Fine.debtor);
 }
Exemplo n.º 3
0
 public void Delete(Guid Id)
 {
     UsingUnitOfWork(unitOfWork =>
     {
         FineEntity Fine = unitOfWork.Fines.Get(Id);
         unitOfWork.Fines.Remove(Fine);
         unitOfWork.Complete();
     });
 }
Exemplo n.º 4
0
        public Fine Add(double DueAmount, string VehicleVin, Guid UserId, Guid DebtorId, Guid VehicleId, string FineResource)
        {
            return(UsingUnitOfWork(unitOfWork =>
            {
                VehicleEntity Vehicle = unitOfWork.Vehicles.Get(VehicleId);
                UserEntity User = unitOfWork.Users.Get(UserId);
                PersonEntity Person = unitOfWork.Persons.Get(DebtorId);
                FineEntity Fine = unitOfWork.Fines.Add(DueAmount, VehicleVin, User, Person, Vehicle, (FineResource)Enum.Parse(typeof(FineResource), FineResource));
                unitOfWork.Complete();

                return new Fine(Fine);
            }));
        }
        public void AssignFineToPerson(PersonEntity Person, FineEntity Fine)
        {
            PersonEntity PersonRecord = Set.Single(person => person.Id == Person.Id);

            PersonRecord.fines.Add(Fine);
        }