Exemple #1
0
 public HttpResponseMessage Properties_List(propertyParams _propertyParams)
 {
     try
     {
         propertyService _propertyService = new propertyService();
         var             _paramters       = new propertyParams()
         {
             DisplayStart  = _propertyParams.DisplayStart,
             DisplayLength = _propertyParams.DisplayLength
         };
         List <propertyViewModel> Properties_List = new List <propertyViewModel>();
         Properties_List = _propertyService.Find(_paramters);
         return(Request.CreateResponse(HttpStatusCode.OK, Properties_List));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Exemple #2
0
        public int InsertProperty(propertyViewModel propertyViewModel, HttpPostedFileBase file)
        {
            UserViewModel     user    = (UserViewModel)Session[SessionEnum.User_Info.ToString()]; // User session.
            propertyService   service = new propertyService();
            propertyViewModel Model   = new propertyViewModel
            {
                Active          = true,
                AddedByUserID   = user.UserID.ToString(),
                AdditionalRooms = propertyViewModel.AdditionalRooms,
                Area            = propertyViewModel.Area,
                AreaTypeID      = propertyViewModel.AreaTypeID,
                Balconies       = propertyViewModel.Balconies,
                Bathrooms       = propertyViewModel.Bathrooms,
                BedRooms        = propertyViewModel.BedRooms,
                CityID          = propertyViewModel.CityID,
                ContactPersonID = "1",
                CountryID       = propertyViewModel.CountryID,
                CreationDate    = Convert.ToDateTime(propertyViewModel.CreationDate),
                Description     = propertyViewModel.Description,
                Floor           = propertyViewModel.Floor,
                FurnitureTypeID = propertyViewModel.FurnitureTypeID,
                LocationLang    = propertyViewModel.LocationLang,
                LocationLat     = propertyViewModel.LocationLat,
                OwnershipTypeID = propertyViewModel.OwnershipTypeID,
                Price           = propertyViewModel.Price,
                PriceTypeID     = propertyViewModel.PriceTypeID,
                ProjectTypeID   = propertyViewModel.ProjectTypeID,
                PropertyID      = propertyViewModel.PropertyID,
                PropertyTitle   = propertyViewModel.PropertyTitle,
                PropertyTypeID  = propertyViewModel.PropertyTypeID,
                ResidanceID     = propertyViewModel.ResidanceID,
                StreetID        = propertyViewModel.StreetID
            };
            int InsertedIncId = 0;
            int result        = service.InsertWithResult(Model, out InsertedIncId);

            return(result);
        }