RealEstate1/RealEstate/Ad.cs

80 lines
1.5 KiB
C#
Raw Normal View History

2024-04-04 10:17:48 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstate
{
public class Ad
{
public int Area
{
get; set;
}
public Category Category
{
get; set;
}
public DateTime CreateAt
{
get; set;
}
public string Description
{
get; set;
}
public int Floors
{
get; set;
}
public bool FreeOfCharge
{
get; set;
}
public int Id
{
get; set;
}
public string ImageUrl
{
get; set;
}
public string LatLong
{
get; set;
}
public int Rooms
{
get; set;
}
public Seller Seller
{
get; set;
}
public static List<Ad> LoadFromCsv(string filename)
{
List<Ad> lista = new List<Ad>();
return lista;
}
public Ad(string adatsor)
{
string[] t = adatsor.Split(';');
Id = int.Parse(t[0]);
Rooms = int.Parse(t[1]);
LatLong = t[2];
Floors = int.Parse(t[3]);
Area = int.Parse(t[4]);
Description = t[5];
FreeOfCharge = (t[6] == "1");
ImageUrl = t[7];
CreateAt = DateTime.Parse(t[8]);
}
}
}