Example #1
0
        public void AnalyzeDef(ref LLGapCompareResults result)
        {
            var iniReader = new IniFile(result.DefFilePath);
            //DEFNotAvailableTo=ORCA
            var defNotAvailable = iniReader.Read("DEFNotAvailableTo", "Common") ?? "";

            if (defNotAvailable.Equals("ORCA", StringComparison.OrdinalIgnoreCase))
            {
                result.IsNotAvailableForOrca = true;
                return;
            }
            else
            {
                result.IsNotAvailableForOrca = false;
            }
            var tcpIp = iniReader.Read("TcpIp", "Common");

            if (tcpIp.Equals("10"))
            {
                result.IsOpenHouseOnlyModule = true;
                return;
            }

            var test  = iniReader.GetSectionNames();
            var test2 = iniReader.GetEntryNames("MLSRecordsEx");

            result.TotalClasses++;
        }
Example #2
0
 public static void GetStatusInfo(LLGapCompareResults compareResult, string status, out string statusName, out string statusValue, out string lastModifyDateFieldName, out string lastModifyDateFiledValue)
 {
     statusValue = "";
     var iniReader = new IniFile(compareResult.DefFilePath);
     lastModifyDateFieldName = iniReader.Read("ST_LastMod", "Standard_Search") ?? "";
     var dateFormat = iniReader.Read("SDateFormat", "field_" + lastModifyDateFieldName) ?? "";
     if (string.IsNullOrEmpty(dateFormat))
         dateFormat = "MM/dd/yyyyTHH:mm:ss";
     lastModifyDateFiledValue = DateTime.Now.AddYears(-10).ToString(dateFormat) + "-" +
                                DateTime.Now.ToString(dateFormat);
     statusName = iniReader.Read("ST_Status", "Standard_Search") ?? "";
     var statusFieldName = "field_" + statusName;
     var statusFormat = iniReader.Read("Format", statusFieldName) ?? "";
     var sortingFormat = iniReader.Read("Format", "Sorting");
     var formatFlag = GetFormatFlag(statusFormat, sortingFormat);
     var delimiter = GetFormatDelimiter(statusFormat);
     var initialValues = new List<string>();
     for (var i = 1; i < 100; i++)
     {
         var val = iniReader.Read("Value" + i, statusFieldName);
         if (!string.IsNullOrEmpty(val))
             initialValues.Add(val);
         else
             break;
     }
     if (initialValues.Count > 0)
     {
         var statusList = status.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         foreach (var item in statusList)
         {
             statusValue += GetStStatus(item, delimiter, initialValues, formatFlag) + ",";
         }
         if (statusValue.EndsWith(","))
             statusValue = statusValue.Substring(0, statusValue.Length - 1);
     }
     else
     {
         statusValue = "";
     }
 }
Example #3
0
        public void AnlyzeAccountAccessResult(ref LLGapCompareResults result)
        {
            if (!string.IsNullOrEmpty(result.TestResult))
                return;

            if (!string.IsNullOrEmpty(result.StatusRdcAccountRequestFailed))
            {
                result.TestResult = PsaConstants.ResultError;
                return;
            }

            if (!string.IsNullOrEmpty(result.StatusRdcAccountSuccess))
            {
                if (string.IsNullOrEmpty(FindGap(result.StatusRdcAccountSuccess, result.TcsPending)))
                {
                    result.TestResult = PsaConstants.AllPendingPresent;
                }
                else
                {
                    result.TestResult = PsaConstants.PartialPending;
                }
                //else if (!string.IsNullOrEmpty(FindCommon(result.StatusRdcAccountSuccess, result.PendingGap)))
                //    result.TestResult = PsaConstants.PartialPendingImprovement;
                //else if (string.IsNullOrEmpty(FindCommon(result.StatusRdcAccountSuccess, result.PendingGap)) && string.IsNullOrEmpty(FindGap(result.StatusRdcAccountSuccess,result.RdcPending)))
                //    result.TestResult = PsaConstants.PartialPendingNoImprovement;
                //else if (!string.IsNullOrEmpty(FindGap(result.StatusRdcAccountSuccess, result.RdcPending)))
                //    result.TestResult = PsaConstants.PartialPendingWorse;
                //else if (string.IsNullOrEmpty(FindCommon(result.StatusRdcAccountSuccess, result.TcsPending)))
                //    result.TestResult = PsaConstants.NoPending;
            }
            else
            {
                result.TestResult = PsaConstants.NoPending;
            }

        }
Example #4
0
 public void WriteToLine(StreamWriter sw, LLGapCompareResults result)
 {
     var sb = new StringBuilder();
     sb.Append(result.ModuleId).Append(",");
     sb.Append("\"").Append(result.ModuleName).Append("\",");
     sb.Append(result.RdcCode).Append(",");
     sb.Append(result.TraceName).Append(",");
     if (result.IsTpAccountLoginSuccess || string.IsNullOrEmpty(result.StatusRdcAccountReturnNoRecord))
         sb.Append("\"").Append(result.StatusHasNoListing ?? "").Append("\",");
     else if (!string.IsNullOrEmpty(result.TpAccountCheckResult))
         sb.Append(result.TpAccountCheckResult).Append(",");
     else
         sb.Append("Error - Authentication failed").Append(",");
     sb.Append("\"").Append(result.URLMappingOpp).Append("\",");
     sb.Append("\"").Append(result.STDFListingDetailsPageURLStatus).Append("\",");
     sb.Append("\"").Append(result.STDFListingDetailsPageURLCount).Append("\",");
     sb.Append("\"").Append(result.STDFListingOfficeURLStatus).Append("\",");
     sb.Append("\"").Append(result.STDFListingOfficeURLCount).Append("\",");
     sb.Append("\"").Append(result.STDFListingBrokerageURLStatus).Append("\",");
     sb.Append("\"").Append(result.STDFListingBrokerageURLCount).Append("\",");
     sb.Append("\"").Append(result.STDFListingFranchiseURLStatus).Append("\",");
     sb.Append("\"").Append(result.STDFListingFranchiseURLCount).Append("\",");
     sb.Append("\"").Append(result.ListingCount).Append("\",");
     sb.Append("\"").Append(result.AG_OfficeURLStatus).Append("\",");
     sb.Append("\"").Append(result.AG_OfficeURLCount).Append("\",");
     sb.Append("\"").Append(result.AG_BrokerageURLStatus).Append("\",");
     sb.Append("\"").Append(result.AG_BrokerageURLCount).Append("\",");
     sb.Append("\"").Append(result.AG_FranchiseURLStatus).Append("\",");
     sb.Append("\"").Append(result.AG_FranchiseURLCount).Append("\",");
     sb.Append("\"").Append(result.AgentCount).Append("\",");
     sb.Append("\"").Append(result.OF_WebsiteURLStatus).Append("\",");
     sb.Append("\"").Append(result.OF_WebsiteURLCount).Append("\",");
     sb.Append("\"").Append(result.OF_BrokerageURLStatus).Append("\",");
     sb.Append("\"").Append(result.OF_BrokerageURLCount).Append("\",");
     sb.Append("\"").Append(result.OF_FranchiseURLStatus).Append("\",");
     sb.Append("\"").Append(result.OF_FranchiseURLCount).Append("\",");
     sb.Append("\"").Append(result.OfficeCount).Append("\",");
     //sb.Append(result.PropertyClass).Append(",");
     //sb.Append("\"").Append(result.TcsPending).Append("\",");
     //sb.Append("\"").Append(result.RdcPending).Append("\",");
     //sb.Append("\"").Append(result.PendingGap).Append("\",");
     //sb.Append("\"").Append(result.TcsActive).Append("\",");
     //sb.Append("\"").Append(result.RdcActive).Append("\",");
     //sb.Append("\"").Append(result.ActiveDifNotInTcs).Append("\",");
     //sb.Append("\"").Append(result.ActiveDifNotInRdc).Append("\",");
     //sb.Append("\"").Append(result.TcsSold).Append("\",");
     //sb.Append("\"").Append(result.RdcSold).Append("\",");
     //sb.Append("\"").Append(result.SoldDifNotInTcs).Append("\",");
     //sb.Append("\"").Append(result.SoldDifNotInRdc).Append("\",");
     //sb.Append("\"").Append(result.TcsOffMarket).Append("\",");
     //sb.Append("\"").Append(result.RdcOffMarket).Append("\",");
     //sb.Append("\"").Append(result.OffMarketDifNotInTcs).Append("\",");
     //sb.Append("\"").Append(result.OffMarketDifNotInRdc).Append("\",");
     //sb.Append("\"").Append(result.TestResult).Append("\",");
     //sb.Append("\"").Append(result.StatusRdcAccountSuccess).Append("\",");
     //sb.Append("\"").Append(result.StatusRdcAccountRequestFailed).Append("\",");
     //sb.Append("\"").Append(result.StatusRdcAccountReturnNoRecord ?? "").Append("\",");
     //sb.Append(result.ProdutionListingCount).Append(",");
     //sb.Append(result.QaListingCount).Append(",");
     // sb.Append(result.IncreaseInActiveCounts ?? "").Append(",");
     //sb.Append(result.RdcCurrentPendingListingCount == 0 ? "" : result.RdcCurrentPendingListingCount.ToString(CultureInfo.InvariantCulture)).Append(",");
     //sb.Append("\"").Append(result.TotalClasses).Append("\",");
     //sb.Append("\"").Append(result.TotalLatLongMapped).Append("\",");
     //sb.Append("\"").Append(result.LatLongClassesMapped).Append("\",");
     //sb.Append("\"").Append(result.LatLongClassesNotMapped).Append("\",");
     //sb.Append("\"").Append(result.LatLongDataExists).Append("\",");
     //sb.Append("\"").Append(result.CandidateDEFs).Append("\",");
     //sb.Append("\"").Append(result.NonCandidateDEFs).Append("\",");
     //sb.Append("\"").Append(result.RawDataInClasses).Append("\",");
     sw.WriteLine(sb.ToString());
 }
Example #5
0
        public void AnalyzeDef(ref LLGapCompareResults result)
        {
            var iniReader = new IniFile(result.DefFilePath);
            //DEFNotAvailableTo=ORCA
            var defNotAvailable = iniReader.Read("DEFNotAvailableTo", "Common") ?? "";
            if (defNotAvailable.Equals("ORCA", StringComparison.OrdinalIgnoreCase))
            {
                result.IsNotAvailableForOrca = true;
                return;
            }
            else
            {
                result.IsNotAvailableForOrca = false;
            }
            var tcpIp = iniReader.Read("TcpIp", "Common");
            if (tcpIp.Equals("10"))
            {
                result.IsOpenHouseOnlyModule = true;
                return;
            }

            var test = iniReader.GetSectionNames();
            var test2 = iniReader.GetEntryNames("MLSRecordsEx");
            //result.LatLongClassesMapped = FindLatLongDEF(iniReader.GetSectionContent("MLSRecordsEX"));

            if (FindLatLongDEF(iniReader.GetSectionContent("MLSRecordsEX")))
            {
                if (result.TotalLatLongMapped == 0)
                {
                    result.LatLongClassesMapped = result.PropertyClass;
                }
                else
                {
                    result.LatLongClassesMapped = result.LatLongClassesMapped + "," + result.PropertyClass;
                }


                result.TotalLatLongMapped++;
            }
            else
            {
                if (result.TotalLatLongMapped == result.TotalClasses)
                {
                    result.LatLongClassesNotMapped = result.PropertyClass;
                }
                else
                {
                    result.LatLongClassesNotMapped = result.LatLongClassesNotMapped + "," + result.PropertyClass;
                }
                
            }

            FindURLFieldsinDEF(iniReader.GetSectionContent("MLSRecordsEX"),ref result);

            result.TotalClasses++;

            result.IsOpenHouseOnlyModule = false;
            result.TcsActive = iniReader.Read("Active", "Sorting") ?? "";
            result.TcsPending = iniReader.Read("Pending", "Sorting") ?? "";
            result.RdcActive = iniReader.Read("Active", "SortingPublicListingStatus") ?? "";
            result.RdcSold = iniReader.Read("Sold", "SortingPublicListingStatus") ?? "";
            result.TcsSold = iniReader.Read("Sold", "Sorting") ?? "";
            result.RdcOffMarket = iniReader.Read("OffMarketOrOther", "SortingPublicListingStatus") ?? "";
            result.TcsOffMarket = iniReader.Read("Expired", "Sorting") ?? "";
            if (!string.IsNullOrEmpty(result.RdcActive))
            {
                result.TcsPendingGap = FindGap(result.TcsActive + "," + result.TcsPending, result.RdcActive);
                result.RdcPendingGap = FindGap(result.RdcActive, result.TcsActive + "," + result.TcsPending);
                result.RdcPending = FindCommon(result.TcsPending, result.RdcActive);
                result.PendingGap = FindGap(result.RdcPending, result.TcsPending);
                result.ActiveDifNotInRdc = FindGap(result.RdcActive, result.TcsActive);
                result.ActiveDifNotInTcs = FindGap(result.TcsActive + "," + result.TcsPending, result.RdcActive);
                result.CurrentRdcPendingStatus = FindCommon(result.TcsPending, result.RdcActive);
            }
            else
            {
                result.RdcActive = result.TcsActive;
                result.TcsPendingGap = "";
                result.RdcPendingGap = "";
                result.PendingGap = result.TcsPending;
                result.RdcPending = "";
                result.ActiveDifNotInRdc = "";
            }
            if (!string.IsNullOrEmpty(result.RdcSold))
            {
                result.SoldDifNotInTcs = FindGap(result.TcsSold, result.RdcSold);
                result.SoldDifNotInRdc = FindGap(result.RdcSold, result.TcsSold);
            }
            else
            {
                result.SoldDifNotInRdc = "";
                result.SoldDifNotInTcs = "";
            }
            if (!string.IsNullOrEmpty(result.RdcOffMarket))
            {
                result.OffMarketDifNotInTcs = FindGap(result.TcsOffMarket + "," + result.TcsPending, result.RdcOffMarket);
                result.OffMarketDifNotInRdc = FindGap(result.RdcOffMarket, result.TcsOffMarket);
            }
            else
            {
                result.OffMarketDifNotInRdc = "";
                result.OffMarketDifNotInTcs = "";
            }
        }
Example #6
0
        public void FindURLFieldsinDEF(string MLSRecordsEx, ref LLGapCompareResults result)
        {
            string[] stringSeparators = new string[] { "\r\n" };
            var RecordMapping = MLSRecordsEx.Split(stringSeparators, StringSplitOptions.None);
            var LDPMapped = false;
            var OfficeURLMapped = false;
            var BrokerURLMapped = false;
            var FranchiseURLMapped = false;
            var ListingSys = new List<string>
                                     {
                                            "stdflistingdetailspageurl", "stdflistingofficeurl", "stdflistingbrokerageurl", 
                                            "stdflistingfranchiseurl", "ag_officeurl", "ag_brokerageurl", "ag_franchiseurl", 
                                            "of_websiteurl", "of_brokerageurl", "of_franchiseurl"
                                     };

            foreach (string line in RecordMapping)
            {
                if(result.IsAgent)
                {
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=ag_officeurl"))
                    {
                        result.AG_OfficeURLStatus = "Mapped";
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=ag_brokerageurl"))
                    {
                        result.AG_BrokerageURLStatus = "Mapped";
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=ag_franchiseurl"))
                    {
                        result.AG_FranchiseURLStatus = "Mapped";
                    }
                }
                else if(result.IsOffice)
                {

                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=of_websiteurl"))
                    {
                        result.OF_WebsiteURLStatus = "Mapped";
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=of_brokerageurl"))
                    {
                        result.OF_BrokerageURLStatus = "Mapped";
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=of_franchiseurl"))
                    {
                        result.OF_FranchiseURLStatus = "Mapped";
                    }
                }
                else
                {
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=stdflistingdetailspageurl"))
                    {
                        LDPMapped = true;
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=stdflistingofficeurl"))
                    {
                        OfficeURLMapped = true;
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=stdflistingbrokerageurl"))
                    {
                        BrokerURLMapped = true;
                    }
                    if ((!line.StartsWith(";")) && line.ToLower().Contains("fldname=stdflistingfranchiseurl"))
                    {
                        FranchiseURLMapped = true;
                    }
                }

            }

            if (LDPMapped)
            {
                if (result.STDFListingDetailsPageURLStatus == "Partial-Mapped")
                {
                }
                else
                {
                    result.STDFListingDetailsPageURLStatus = "Mapped";
                }
            }
            else
            {
                if (result.STDFListingDetailsPageURLStatus == "Mapped")
                {
                    result.STDFListingDetailsPageURLStatus = "Partial-Mapped";
                }
            }


            if (OfficeURLMapped)
            {
                if (result.STDFListingOfficeURLStatus == "Partial-Mapped")
                {
                }
                else
                {
                    result.STDFListingOfficeURLStatus = "Mapped";
                }
            }
            else
            {
                if (result.STDFListingOfficeURLStatus == "Mapped")
                {
                    result.STDFListingOfficeURLStatus = "Partial-Mapped";
                }
            }

            if (BrokerURLMapped)
            {
                if (result.STDFListingBrokerageURLStatus == "Partial-Mapped")
                {
                }
                else
                {
                    result.STDFListingBrokerageURLStatus = "Mapped";
                }
            }
            else
            {
                if (result.STDFListingBrokerageURLStatus == "Mapped")
                {
                    result.STDFListingBrokerageURLStatus = "Partial-Mapped";
                }
            }

            if (FranchiseURLMapped)
            {
                if (result.STDFListingFranchiseURLStatus == "Partial-Mapped")
                {
                }
                else
                {
                    result.STDFListingFranchiseURLStatus = "Mapped";
                }
            }
            else
            {
                if (result.STDFListingFranchiseURLStatus == "Mapped")
                {
                    result.STDFListingFranchiseURLStatus = "Partial-Mapped";
                }
            }

        }