예제 #1
0
 public void SaveToSpreadsheet(WorkSheet worksheet, int rowIndex)
 {
     worksheet.SetCell(rowIndex, "Address", Address);
     worksheet.SetCell(rowIndex, "Neighborhood", Neighboorhood);
     worksheet.SetCell(rowIndex, "SqFeet", SquareFootageAsInt);
     worksheet.SetCell(rowIndex, "Rooms", BedroomsAsInt);
     worksheet.SetCell(rowIndex, "Price", RentAsDouble);
     worksheet.SetCell(rowIndex, "Structure", UnitDetails);
     worksheet.SetCell(rowIndex, "Comments", Comments);
     worksheet.SetCell(rowIndex, "V", Visited);
     worksheet.SetCell(rowIndex, "C", Called);
     if (Rating != "")
     {
         worksheet.SetCell(rowIndex, "R", RatingAsInt);
     }
     worksheet.SetCellFormula(rowIndex, "Link", $"={SpreadsheetHyperlink}");
     worksheet.SetCellFormula(rowIndex, "Map", $"=HYPERLINK(\"http://maps.google.com/?q={Address}\",\"Map\")");
     worksheet.SetCellFormula(rowIndex, "Redfin", $"=HYPERLINK(\"https://www.google.com/search?q={Address} Redfin\",\"Redfin\")");
     worksheet.SetCell(rowIndex, "Contact", Contact);
     worksheet.SetCell(rowIndex, "D", Amenities.Any(a => a.Contains("dishwasher", StringComparison.OrdinalIgnoreCase)) ? "X" : "");
     worksheet.SetCell(rowIndex, "L", HasLaundry());
 }