Esempio n. 1
0
 public static PropertySummaryData GetProperty(string propertybbl)
 {
     using (GPADBEntities1 gpaE = new GPADBEntities1())
     {
         return(Mapper.Map <PropertySummaryData>(gpaE.vwGeneralPropertyInformations.Where(x => x.BBLE == propertybbl).FirstOrDefault()));
     }
 }
Esempio n. 2
0
        public static List <ScenarioListData> GetScenarios(string userName)
        {
            try
            {
                using (GPADBEntities1 gpaE = new GPADBEntities1())
                {
                    List <ScenarioListData> resultList = null;

                    foreach (var rec in gpaE.SavedScenarios.Where(m => m.UserName == userName).OrderByDescending(m => m.DateTimeSaved).ToList())
                    {
                        if (resultList == null)
                        {
                            resultList = new List <ScenarioListData>();
                        }
                        var result = new ScenarioListData();
                        result.ScenarioName  = rec.ScenarioName;
                        result.ScenarioId    = rec.ScenarioId;
                        result.DateTimeSaved = rec.DateTimeSaved;
                        result.Description   = rec.Description;

                        resultList.Add(result);
                    }
                    return(resultList);
                }
            }
            catch (Exception e)
            {
                Common.Logs.log().Error(string.Format("Exception encountered getting scenarios for user: {0}{1}", userName, Common.Logs.FormatException(e)));
                return(null);
            }
        }
Esempio n. 3
0
 public static List <LeadSummaryData> GetPropertyLeads(string zipcodes, string neighborhoods, string isvacant, string leadgrades, string buildingclasscodes, string counties,
                                                       string ismailingaddressactive, string lientypes, string ltv, string equity, string violations, string cities,
                                                       string states, string hasfannie, string hasfreddie, string unbuilt, string servicer, string landmark, string hasFHA)
 {
     using (GPADBEntities1 gpaE = new GPADBEntities1())
     {
         return(Mapper.Map <List <vwGeneralLeadInformation>, List <LeadSummaryData> >(gpaE.GetLeads(zipcodes, buildingclasscodes, counties, isvacant, ismailingaddressactive, violations,
                                                                                                    cities, neighborhoods, states, lientypes, leadgrades, ltv, equity, hasfannie,
                                                                                                    hasfreddie, unbuilt, servicer, landmark, hasFHA).ToList()));
     }
 }
Esempio n. 4
0
 public static long SaveScenario(string userName, string scenarioName, string description, string zipcodes, string neighborhoods, string isvacant, string leadgrades,
                                 string buildingclasscodes, string counties, string ismailingaddressactive, string lientypes, string ltv, string equity, string violations,
                                 string cities, string states, string hasFannie, string hasFreddie, string unbuilt, string servicer, string landmark, string hasFHA)
 {
     try
     {
         using (GPADBEntities1 gpaE = new GPADBEntities1())
         {
             var scenarioObj = new GPADB.SavedScenario();
             scenarioObj.BuildingClassCodes = buildingclasscodes;
             scenarioObj.Cities             = cities;
             scenarioObj.Counties           = counties;
             scenarioObj.DateTimeSaved      = DateTime.UtcNow;
             scenarioObj.Description        = description;
             scenarioObj.HasFannie          = hasFannie;
             scenarioObj.HasFreddie         = hasFreddie;
             scenarioObj.HasFHA             = hasFHA;
             scenarioObj.Landmark           = landmark;
             scenarioObj.LeadGrades         = leadgrades;
             scenarioObj.LienTypes          = lientypes;
             scenarioObj.LTV = ltv;
             scenarioObj.MailingAddressActive = ismailingaddressactive;
             scenarioObj.Neighborhoods        = neighborhoods;
             scenarioObj.ScenarioName         = scenarioName;
             scenarioObj.Servicer             = servicer;
             scenarioObj.States      = states;
             scenarioObj.UnbuiltArea = unbuilt;
             scenarioObj.UserName    = userName;
             scenarioObj.Vacant      = isvacant;
             scenarioObj.Violations  = violations;
             scenarioObj.ZipCode     = zipcodes;
             gpaE.SavedScenarios.Add(scenarioObj);
             gpaE.SaveChanges();
             return(scenarioObj.ScenarioId);
         }
     }
     catch (DbEntityValidationException dbEx)
     {
         foreach (var validationErrors in dbEx.EntityValidationErrors)
         {
             foreach (var validationError in validationErrors.ValidationErrors)
             {
                 Common.Logs.log().Error(string.Format("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage));
             }
         }
         return(-1);
     }
     catch (Exception e)
     {
         Common.Logs.log().Error(string.Format("Exception encountered saving scenario {0} for {1}{2}", scenarioName, userName, Common.Logs.FormatException(e)));
         return(-1);
     }
 }