CapDemo.BL.RecordBL.ExistRecord C# (CSharp) Метод

ExistRecord() публичный Метод

public ExistRecord ( Record Record ) : bool
Record CapDemo.DO.Record
Результат bool
        public bool ExistRecord(Record Record)
        {
            string query = "SELECT [Contest_ID]"
                        + " FROM [Record]";
            DataTable dt = DA.SelectDatabase(query);
            int i = 0;
            if (dt != null)
            {
                foreach (DataRow item in dt.Rows)
                {
                    if (Convert.ToInt32(item["Contest_ID"].ToString()) == Record.IDContest)
                    {
                        i++;
                    }
                }
            }
            if (i== 0 || i<Record.AmountTeam)
            {
                return false;
            }
            else
            {
                return true;
            }
        }