using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Entity;
using BLL;

public partial class Admin_Subject_AddSubjectOfJudge : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RoleCheck.DenyLogin();
        if (!IsPostBack)
        {
            txtQuestion.Focus();
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        SubjectOfJudge subject = new SubjectOfJudge();
        SubjectTypeCategory category = new SubjectTypeCategory();
        category.CateID = Convert.ToInt32(drpSubjectTypeCategory.SelectedValue);
        subject.Category = category;
        subject.Question = txtQuestion.Text;
        subject.Answer = txtAnswer.Text.Equals("Y") ? true : false;

        new BLLSubjectOfJudge().CreateSubject(subject);
        Response.Redirect("SubjectOfJudgeList.aspx");
    }
}
