CapDemo.BL.ContestBL.ExistContest C# (CSharp) 메소드

ExistContest() 공개 메소드

public ExistContest ( Contest Contest ) : bool
Contest CapDemo.DO.Contest
리턴 bool
        public bool ExistContest(Contest Contest)
        {
            string query = "SELECT [Contest_ID],[Round_ID],[Contest_Name],[Bonus],[Request_Time],[Challenge_Score],[Number_Challenge]"
                        + ",[Time_show_Anwer],[Time_show_Question],[Time_of_True],[Time_of_False]"
                        + " FROM [Contest]";
            DataTable dt = DA.SelectDatabase(query);
            int i = 0;
            if (dt != null)
            {
                foreach (DataRow item in dt.Rows)
                {
                    if (Convert.ToInt32(item["Round_ID"])==Contest.IDRound && item["Contest_Name"].ToString().ToUpper()==Contest.NameContest.ToUpper())
                    {
                        i++;
                    }
                }
            }
            if (i==0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }