/// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="submitter">osoba koja prijavljuje kvar</param>
 /// <param name="subject">naziv kvara</param>
 /// <param name="description">opis kvara</param>
 /// <param name="location">lokacija gdje se kvar desio</param>
 public MaintenanceRequest(Person submitter, string subject, string description, string location)
 {
     this.submitter = new PersonSnapshot(submitter);
     this.subject = subject;
     this.description = description;
     this.location = location;
     dateTimeOfRequest = DateTime.Now;
 }
        public static Building getBuilding(Person person)
        {
            Building buildingForMock = new Building(getBuildingManager()) {
                LandRegistry = getLandRegistry()
            };

            return buildingForMock;
        }
 /// <summary>
 /// Provjerava da li je vlasnik glasao
 /// </summary>
 /// <param name="owner">vlasnik</param>
 /// <returns>true ako je glasao, inace false</returns>
 public virtual bool IsOwnerVoted(Person owner)
 {
     return ownerVotes.Any(ownerVote => ownerVote.Owner.Oib == owner.Oib);
 }
        public void SetUp()
        {
            // Dohvacanje osobe iz repozitorija
            person = getPerson();

            // Dohvacanje zgrade za zadanu osobu
            building = getBuilding(person);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Konstruktor (izdaje pričuva/zgrada za osobu)
        /// </summary>
        /// <param name="reserve">pričuva</param>
        /// <param name="personTo">osoba koja placa racun</param>
        /// <param name="paymentDescription">opis placanja</param>
        /// <param name="tax">porez/PDV</param>
        public Bill(Reserve reserve, Person personTo, string paymentDescription, short tax)
        {
            from = null;
            this.reserve = reserve;
            to = new PersonSnapshot(personTo);
            this.paymentDescription = paymentDescription;
            this.tax = tax;
            dateTimeIssued = DateTime.Now;
            isPaid = false;

            billItems = new List<BillItem>();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="person">osoba</param>
 public PersonSnapshot(Person person)
 {
     fullName = person.FullName;
     oib = person.Oib;
     address = person.Address;
 }
 /// <summary>
 /// Dohvaca korisnika na temelju osobe
 /// </summary>
 /// <param name="person">osoba</param>
 /// <returns>korisnik</returns>
 public HousingMgmtUser GetUserByPerson(Person person)
 {
     return Session.QueryOver<HousingMgmtUser>()
         .Where(hmu => hmu.Person.Id == person.Id)
         .SingleOrDefault();
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Stvara i dodaje etazu zajednickog vlasnistva u zamljisnu knjigu
        /// </summary>
        /// <param name="registryNumber">broj uloška</param>
        /// <param name="surfaceArea">povrsina etaze</param>
        /// <param name="description">opis etaze</param>
        /// <param name="owner">vlasnici</param>
        /// <returns>novostvorena etaza zajednickog vlasnistva</returns>
        public virtual IPartitionSpace CreatePartitionSpace(string registryNumber, decimal surfaceArea, string description, Person owner)
        {
            if (TotalSurfaceOfPartitionSpaces + surfaceArea > cadastralParticle.SurfaceArea) {
                throw new BusinessRulesException("Ukupna površina svi etaža zajedno sa ovom etažom bila bi veća od ukupne površine katastarske čestice.");
            }

            var ordinalNumber = partitionSpaces.Any() ? partitionSpaces.Last().OrdinalNumber + 1 : 1;
            PartitionSpace partitionSpace = new PartitionSpace(this, registryNumber, ordinalNumber, surfaceArea, description) {
                Owner = owner
            };

            partitionSpaces.Add(partitionSpace);

            return partitionSpace;
        }