Example #1
0
        private static WebDataDB.NoticeOfProperyValue CopyData(WebDataDB.NoticeOfProperyValue resultObj, RequestResponseBuilder.ResponseObjects.NoticeOfPropertyValue valObj)
        {
            if (resultObj == null)
            {
                resultObj = new WebDataDB.NoticeOfProperyValue();
            }

            resultObj.BuildingClass                    = Conversions.GetSingleValue(valObj.BuildingClass);
            resultObj.PrimaryZoning                    = Conversions.Concat(valObj.PrimaryZoning);
            resultObj.LotFrontage                      = Conversions.ToDecimalorNull(valObj.LotFrontage);
            resultObj.LotDepth                         = Conversions.ToDecimalorNull(valObj.LotDepth);
            resultObj.LotSquareFootage                 = Conversions.ToDecimalorNull(valObj.LotSquareFootage);
            resultObj.LotShape                         = Conversions.Concat(valObj.LotShape);
            resultObj.LotType                          = Conversions.Concat(valObj.LotType);
            resultObj.Proximity                        = Conversions.Concat(valObj.Proximity);
            resultObj.BuildingFrontage                 = Conversions.ToDecimalorNull(valObj.BuildingFrontage);
            resultObj.BuildingDepth                    = Conversions.ToDecimalorNull(valObj.BuildingDepth);
            resultObj.NumberOfBuildings                = Conversions.ToIntorNull(valObj.NumberofBuildings);
            resultObj.Style                            = Conversions.Concat(valObj.Style);
            resultObj.YearBuilt                        = Conversions.Concat(valObj.YearBuilt);
            resultObj.ExteriorCondition                = Conversions.Concat(valObj.ExteriorCondition);
            resultObj.FinishedSquareFootage            = Conversions.ToDecimalorNull(valObj.FinishedSquareFootage);
            resultObj.UnfinishedSquareFootage          = Conversions.ToDecimalorNull(valObj.UnfinishedSquareFootage);
            resultObj.CommercialUnits                  = Conversions.ToIntorNull(valObj.CommercialUnits);
            resultObj.CommercialSquareFootage          = Conversions.ToDecimalorNull(valObj.CommercialSquareFootage);
            resultObj.ResidentialUnits                 = Conversions.ToIntorNull(valObj.ResidentialUnits);
            resultObj.GarageType                       = Conversions.Concat(valObj.GarageType);
            resultObj.GarageSquareFootage              = Conversions.ToDecimalorNull(valObj.GarageSquareFootage);
            resultObj.BasementGrade                    = Conversions.Concat(valObj.BasementGrade);
            resultObj.BasementSquareFootage            = Conversions.ToDecimalorNull(valObj.BasementSquareFootage);
            resultObj.BasementType                     = Conversions.Concat(valObj.BasementType);
            resultObj.ConstructionType                 = Conversions.Concat(valObj.ConstructionType);
            resultObj.ExteriorWall                     = Conversions.Concat(valObj.ExteriorWall);
            resultObj.NumberOfStories                  = Conversions.ToDecimalorNull(valObj.NumberofStories);
            resultObj.StructureType                    = Conversions.Concat(valObj.StructureType);
            resultObj.Grade                            = Conversions.Concat(valObj.Grade);
            resultObj.GrossSquareFootage               = Conversions.ToDecimalorNull(valObj.GrossSquareFootage);
            resultObj.CommercialOverlay                = Conversions.Concat(valObj.CommercialOverlay);
            resultObj.LandFactorPerSqFtinDollars       = Conversions.ToDecimalorNull(valObj.LandFactorperSquareFoot);
            resultObj.GrossResidentialSquareFootage    = Conversions.ToDecimalorNull(valObj.GrossResidentialSquareFootage);
            resultObj.LandType1                        = Conversions.Concat(valObj.LandType1);
            resultObj.LandSize1                        = Conversions.ToDecimalorNull(valObj.LandSize1);
            resultObj.NumberOfRooms                    = Conversions.ToIntorNull(valObj.NumberOfRooms);
            resultObj.HotelClass                       = Conversions.Concat(valObj.HotelClass);
            resultObj.NumberOfResidentialLots          = Conversions.ToIntorNull(valObj.NumberOfResidentialLots);
            resultObj.NumberOfCommercialLots           = Conversions.ToIntorNull(valObj.NumberOfCommercialLots);
            resultObj.GrossSquareFootageOfTheSuffix    = Conversions.ToDecimalorNull(valObj.GrossSquareFootageOfTheSuffix);
            resultObj.CommercialLots                   = Conversions.ToIntorNull(valObj.CommercialLots);
            resultObj.LandFactorperSquareFoot          = Conversions.ToDecimalorNull(valObj.LandFactorperSquareFoot);
            resultObj.NetSqFtOfLotFromCondoDeclaration = Conversions.ToDecimalorNull(valObj.NetSquareFootageoftheLotfromtheCondoDeclaration);
            resultObj.ResidentialLots                  = Conversions.ToIntorNull(valObj.ResidentialLots);

            return(resultObj);
        }
Example #2
0
        /// <summary>
        ///     This method gets the data or current status for a request
        /// </summary>
        /// <param name="dataRequestLogObj"></param>
        /// <returns></returns>
        public static NoticeOfPropertyValueResult ReRun(DataRequestLog dataRequestLogObj)
        {
            NoticeOfPropertyValueResult resultObj = new NoticeOfPropertyValueResult();

            resultObj.BBL                 = dataRequestLogObj.BBL;
            resultObj.requestId           = dataRequestLogObj.RequestId;
            resultObj.externalReferenceId = dataRequestLogObj.ExternalReferenceId;
            resultObj.status              = ((RequestStatus)dataRequestLogObj.RequestStatusTypeId).ToString();

            try
            {
                using (WebDataEntities webDBEntities = new WebDataEntities())
                {
                    if (dataRequestLogObj.RequestStatusTypeId == (int)RequestStatus.Success)
                    {
                        Parameters parameters = JSONToParameters(dataRequestLogObj.RequestParameters);
                        //check if data available
                        WebDataDB.NoticeOfProperyValue noticeOfPropetyValueObj = webDBEntities.NoticeOfProperyValues.FirstOrDefault(i => i.BBL == parameters.BBL);

                        if (noticeOfPropetyValueObj != null && DateTime.UtcNow.Subtract(noticeOfPropetyValueObj.LastUpdated).Days <= 30)
                        {
                            resultObj.noticeOfPropertyValue = noticeOfPropetyValueObj;
                        }
                        else
                        {
                            resultObj.status = RequestStatus.Error.ToString();
                        }
                    }
                }
                return(resultObj);
            }
            catch (Exception e)
            {
                Common.Logs.log().Error(string.Format("Exception encountered processing request log for {0} with externalRefId {1}{2}",
                                                      dataRequestLogObj.BBL, dataRequestLogObj.ExternalReferenceId, Common.Logs.FormatException(e)));
                return(null);
            }
        }