Example #1
0
        public static void TakeApart()
        {
            ApartTypeList.Clear();
            string query = "SELECT * FROM hotel.room_types;";
            List <Dictionary <string, string> > UR = Database.Select(query, ApartType.ApartTypeKeys);

            if (UR.Count != 0)
            {
                foreach (var item in UR)
                {
                    ApartType ur = new ApartType(Int32.Parse(item["id"]),
                                                 item["room_type"]);
                    ApartTypeList.Add(ur);
                }
            }
        }
Example #2
0
        public static int NameToId(string _name)
        {
            ApartType tmp = ApartTypeList.Find(x => x.Name == _name);

            return(tmp.Id);
        }