示例#1
0
        public static LocationModel SendPOST(Lead customer)
        {
            LocationInputModel location = new LocationInputModel();

            location.Branch = customer.location.name.Substring(8);

            string[] names = Postman.ExtractMatches(PPRGX.NAMES.Match(customer.name));
            location.FirstName = names[0];
            location.LastName  = names[1];

            string[] locinfo = Postman.ExtractMatches(Regex.Match(customer.address, ModifiedLocInfoPat));
            location.State   = stateAbbrvs[locinfo[2]];
            location.Address = locinfo[0];
            location.City    = locinfo[1];
            location.Zip     = locinfo[3];
            location.TaxCode = PestPacGeoCoding.GetTaxCode(new Params(locinfo[0], locinfo[1], location.State, locinfo[3]));

            location.Phone       = customer.phone;
            location.EMail       = customer.email;
            location.EnteredDate = customer.created_at;

            location.UserDefinedFields = new List <UserDefinedField>()
            {
                new UserDefinedField("# Services", customer.services.ToString())
            };

            names   = null;
            locinfo = null;

            return(client.CreateLocation(location));
        }
示例#2
0
        // TODO: return a more complex type
        public dynamic AddLocation(LocationInputModel model)
        {
            var address = Mapper.Map <Address>(model);

            var location = new Location.Location(Settings);

            location.Add(address);

            return(true);
        }
 public dynamic AddLocation(LocationInputModel model)
 {
     if (_locationService.AddLocation(model))
     {
         return new { Success = true, }
     }
     ;
     else
     {
         return new { Success = false, }
     };
 }
        public async Task <IActionResult> FindProperties([FromQuery] LocationInputModel inputModel)
        {
            try
            {
                var latitude   = double.Parse(inputModel.At.Split(",")[0]);
                var longtitude = double.Parse(inputModel.At.Split(",")[1]);
                var result     = await propertiesService.GetProperties(latitude, longtitude);

                return(this.Json(result));
            }
            catch (Exception)
            {
                return(this.NotFound());
            }
        }
示例#5
0
 public dynamic Delete(LocationInputModel model)
 {
     return(PresentationService.Location.RemoveLocation(model.Longitude, model.Latitude));
 }
示例#6
0
 public dynamic Post(LocationInputModel model)
 {
     return(PresentationService.Location.AddLocation(model));
 }
 public JsonApiOutput <IEnumerable <CinemaMovieProjectionsOutputModel> > searchCinemasFromMovie([FromUri] DateRangeInputModel dateRange, [FromUri] LocationInputModel location, [FromUri] string imdbid)
 {
     return(new JsonApiOutput <IEnumerable <CinemaMovieProjectionsOutputModel> >(
                DatabaseAdapter.QueryCinemaProjectionsFromMovie(location.Latitude, location.Longitude, location.MaxRange, imdbid, dateRange.StartDate, dateRange.EndDate)
                .Select <CinemaProjections, CinemaMovieProjectionsOutputModel>(i => new CinemaMovieProjectionsOutputModel(i))));
 }
 public JsonApiOutput <IEnumerable <MovieOutputModel> > searchMoviesFromLocation([FromUri] DateRangeInputModel dateRange, [FromUri] LocationInputModel location)
 {
     return
         (new JsonApiOutput <IEnumerable <MovieOutputModel> >(
              DatabaseAdapter.QueryMoviesFromLocation(location.Latitude, location.Longitude, location.MaxRange, dateRange.StartDate, dateRange.EndDate)
              .Select <Movie, MovieOutputModel>(i => new MovieOutputModel(i))
              ));
 }
 public JsonApiOutput <IEnumerable <CinemaOutputModel> > searchCinemaByLocation([FromUri] LocationInputModel location)
 {
     return
         (new JsonApiOutput <IEnumerable <CinemaOutputModel> >(
              DatabaseAdapter.QueryCinemaByLocation(location.Latitude, location.Longitude, location.MaxRange)
              .Select <Cinema, CinemaOutputModel>(i => new CinemaOutputModel(i))
              ));
 }