示例#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>());
 }