protected void SubmitButton_Click(object sender, EventArgs e) { int[] scores = new int[18]; scores[0] = int.Parse(Par1.SelectedValue); scores[1] = int.Parse(Par2.SelectedValue); scores[2] = int.Parse(Par3.SelectedValue); scores[3] = int.Parse(Par4.SelectedValue); scores[4] = int.Parse(Par5.SelectedValue); scores[5] = int.Parse(Par6.SelectedValue); scores[6] = int.Parse(Par7.SelectedValue); scores[7] = int.Parse(Par8.SelectedValue); scores[8] = int.Parse(Par9.SelectedValue); scores[9] = int.Parse(Par10.SelectedValue); scores[10] = int.Parse(Par11.SelectedValue); scores[11] = int.Parse(Par12.SelectedValue); scores[12] = int.Parse(Par13.SelectedValue); scores[13] = int.Parse(Par14.SelectedValue); scores[14] = int.Parse(Par15.SelectedValue); scores[15] = int.Parse(Par16.SelectedValue); scores[16] = int.Parse(Par17.SelectedValue); scores[17] = int.Parse(Par18.SelectedValue); int total = 0; for (int i = 0; i < scores.Length; i++) { total = total + scores[i]; } string email = UsersOnReservationDD.SelectedValue; ClubBAIST cb = new ClubBAIST(); SecurityController s = HttpContext.Current.User as SecurityController; bool b; if (s != null) { if (Request.QueryString["r"] != null) { if (s.IsInAnyRoles("ADMIN")) { b = cb.CreateScore(int.Parse(Request.QueryString["r"]), email, scores, total); Response.Redirect("Default.aspx"); } else { User u = cb.ReadUser(HttpContext.Current.User.Identity.Name); b = cb.CreateScore(int.Parse(Request.QueryString["r"]), u.Email, scores, total); Response.Redirect("Default.aspx"); } } } }