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

EditExistContest() 공개 메소드

public EditExistContest ( Contest Contest ) : bool
Contest CapDemo.DO.Contest
리턴 bool
        public bool EditExistContest(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() && Convert.ToInt32(item["Contest_ID"])!=Contest.IDContest)
                    {
                        i++;
                    }
                }
            }
            if (i == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }