BoxInformation.Model.BoxEntry.Get C# (CSharp) Method

Get() public method

public Get ( string boxId ) : void
boxId string
return void
        public void Get(string boxId)
        {
            DataSet entry = dataAccess.FillDataSet("GetRecordByID", CommandType.StoredProcedure, dataAccess.CreateParameter("@ID", boxId));

            if (entry.Tables.Count < 1 || entry.Tables.Count > 1)
            {
                throw new InvalidOperationException("Multiple data tables returned when only one expected");
            }

            if (entry.Tables[0].Rows.Count != 1)
            {
                throw new InvalidOperationException("Multiple rows of data returned when only one expected");
            }

            PopulateView(entry.Tables[0].Rows[0]);
        }