Exemplo n.º 1
0
        internal LocationInfo getLocationInfo(int ID_Location)
        {
            FormattableString SQL  = $"SELECT * FROM LocationInfo WHERE ID_Location = {ID_Location}"; //Correggere *
            DataSet           data = db.Query(SQL);

            if (data.Tables[0].Rows.Count == 0)
            {
                return(null);
            }

            DataRow dr = data.Tables[0].Rows[0];

            return(new LocationInfo()
            {
                ID_Location = dr.Field <int>("ID_Location"),
                Business_Name = dr.Field <string>("Business_Name"),
                //People_Count = dr.Field<long>("People_Count"),
                Address = dr.Field <string>("Address"),
                PostalCode = dr.Field <string>("PostalCode"),
                City = dr.Field <string>("City")
            });
        }