Exemple #1
0
 public CountersToUpdateViewModel()
 {
     Counters    = new List <Counter>();
     Flats       = new List <Flat>();
     Street      = new Street();
     HouseNumber = new HouseNumber();
 }
Exemple #2
0
        // --- HOUSE NUMBERS
        public IEnumerable <HouseNumber> GetHouseNumbers(int StreetId)
        {
            List <HouseNumber> houseNumbers = new List <HouseNumber>();

            using (SqlConnection conn = new SqlConnection(connString))
            {
                SqlCommand cmd = new SqlCommand("select*from houseNumbers where StreetId=@StreetId", conn);
                cmd.Parameters.AddWithValue("@StreetId", StreetId);
                conn.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    HouseNumber hn = new HouseNumber();
                    hn.Id   = Convert.ToInt32(rdr["Id"]);
                    hn.Name = rdr["Name"].ToString();
                    houseNumbers.Add(hn);
                }
                conn.Close();
            }
            return(houseNumbers);
        }
Exemple #3
0
 public FlatsStreetsHouses()
 {
     FlatData    = new List <FlatCounterDataViewModel>();
     Street      = new Street();
     HouseNumber = new HouseNumber();
 }