예제 #1
0
        //Methods

        public string PrintInfo()
        {
            string msg = "";

            msg += propertyNumber + ", " + propertySuburb + ", " + PropertyBedroomNum + ", " +
                   PropertyRent.ToString("C") + ", " + propertyStatus + "\n";
            return(msg);
        }
예제 #2
0
        public void UpdatePropertyRent(PropertyRent p)
        {
            if (p == null)
            {
                throw new ArgumentNullException("property is null");
            }

            _propertyRentRepository.Update(p);
            _eventPublisher.EntityUpdated(p);
        }
예제 #3
0
        public void DeletePropertyRent(PropertyRent p)
        {
            if (p == null)
            {
                throw new ArgumentNullException("property is null");
            }

            p.Deleted = true;
            UpdatePropertyRent(p);
        }
예제 #4
0
        public PropertyRentModel SaveRentProperty(PropertyRentModel model)
        {
            try
            {
                var rent = new PropertyRent();
                if (model.PropertyId > 0)
                {
                    rent = _db.PropertyRents.FirstOrDefault(x => x.PropertyId == model.PropertyId);
                }

                rent.Locality           = model.Locality;
                rent.PropertyTypeId     = model.PropertyTypeId;
                rent.SecurityAmount     = model.SecurityAmount;
                rent.MaintenanceCharges = model.MaintenanceCharges;
                rent.Address            = model.Address;
                rent.ADType             = model.ADType;
                rent.Area            = model.Area;
                rent.AU              = model.AU;
                rent.AvailableDate   = model.AvailableDate;
                rent.AvailableStatus = model.AvailableStatus;
                rent.BathroomNum     = model.BathroomNum;
                rent.BikeParking     = model.BikeParking;
                rent.CarParking      = model.CarParking;
                rent.CityId          = model.CityId;
                rent.ExpectedPrice   = model.ExpectedPrice;
                rent.FacingId        = model.FacingId;
                rent.FloorNum        = model.FloorNum;
                rent.FurnishedType   = model.FurnishedType;
                rent.Lift            = model.Lift;
                rent.Mobile          = model.Mobile;
                rent.ProjectSociety  = model.ProjectSociety;
                rent.PropertyName    = model.PropertyName;
                rent.SecurityAmount  = model.SecurityAmount;
                rent.TotalFloor      = model.TotalFloor;
                rent.Water           = model.Water;
                rent.ModifiedDate    = DateTime.UtcNow;
                rent.UserId          = model.UserId;
                rent.BedRooms        = model.BedRooms;

                if (model.PropertyId == 0)
                {
                    _db.PropertyRents.Add(rent);
                }


                _db.SaveChanges();
                model.PropertyId = rent.PropertyId;
                return(model);
            }
            catch { throw; }
        }
예제 #5
0
 public static PropertyRent ToEntity(this PropertyRentModel createmodel, PropertyRent destination)
 {
     return(createmodel.MapTo(destination));
 }
예제 #6
0
 public static PropertyRentApproveListModel ToListModel(this PropertyRent entity)
 {
     return(entity.MapTo <PropertyRent, PropertyRentApproveListModel>());
 }