protected void Create_Click(object sender, EventArgs e) { TestComponents tc = new TestComponents(); Entities.Test test = new Entities.Test(); test.Name = NameId.Value; test.Description = DescrId.Value; test.Type = type; test.Author = Session["UserLogin"].ToString(); test.Time = new TimeSpan(int.Parse(HourTimeId.Value), int.Parse(MinuteTimeId.Value), int.Parse(SecondTimeId.Value)); test.Questions.AddRange(QuestionList); tc.AddTest(test); Response.Redirect("Default.aspx"); }
protected void Update_Click(object sender, EventArgs e) { TestComponents tc = new TestComponents(); test.Name = NameId.Value; test.Description = DescrId.Value; test.Type = type; test.Author = Session["UserLogin"].ToString(); test.Time = new TimeSpan(0, 5, 0); test.Questions.Clear(); test.Questions.AddRange(QuestionList); tc.UpdateTest(test); Response.Redirect("Default.aspx"); }