예제 #1
0
 // 新建问题
 public bool create(Problem obj)
 {
     DataClassesDataContext da = new DataClassesDataContext();
     da.Problem.InsertOnSubmit(obj);
     da.SubmitChanges();
     return true;
 }
예제 #2
0
        protected void AProSureButton_Click(object sender, EventArgs e)
        {
            Problem Apro = new Problem();
            Apro.assignment = int.Parse(Request.QueryString["Assignmentid"].ToString());
            Apro.title = AProtitleTextBox.Text;
            Apro.descrip = AProdescriTextBox.Text;
            Apro.score = float.Parse(scoreTextBox.Text);

            ProMan.create(Apro);
            Response.Redirect("OneAssignment.aspx?Assignmentid=" + Request.QueryString["Assignmentid"] + "&Assignmentnum=" + Request.QueryString["Assignmentnum"]);
        }
예제 #3
0
        //添加该作业的一个问题
        protected void AProSureButton_Click(object sender, EventArgs e)
        {
            AProPanel.Visible = false;

            Assignment assignment = (Assignment)Session["Aassignment"];
            Problem Apro = new Problem();
            problems = (List<Problem>)Session["problems"];

            Apro.score = float.Parse(AProscoreTextBox.Text);
            Apro.title = AProtitleTextBox.Text;
            Apro.descrip = AProdescriTextBox.Text;
            Apro.assignment = assignment.id;

            problems.Add(Apro);
            Session["problems"] = problems;

            SelectProRadioButtonList.Items.Clear();
            for (int i = 0; i != problems.Count; i++)
            {
                SelectProRadioButtonList.Items.Add(new ListItem(i+1 + "." + problems[i].title + "<br>" + problems[i].descrip, i.ToString()));
            }
        }
예제 #4
0
 partial void DeleteProblem(Problem instance);
예제 #5
0
		private void detach_Problem(Problem entity)
		{
			this.SendPropertyChanging();
			entity.Assignment1 = null;
		}
예제 #6
0
 partial void UpdateProblem(Problem instance);
예제 #7
0
		private void attach_Problem(Problem entity)
		{
			this.SendPropertyChanging();
			entity.Assignment1 = this;
		}
예제 #8
0
 partial void InsertProblem(Problem instance);
예제 #9
0
 //更新问题
 public bool UpdateProblem(Problem pro)
 {
     DataClassesDataContext da = new DataClassesDataContext();
     var p = from s in da.Problem
             where s.id == pro.id
             select s;
     foreach (Problem problem in p)
     {
         problem.id = pro.id;
         problem.assignment = pro.assignment;
         problem.title = pro.title;
         problem.descrip = pro.descrip;
         problem.score = pro.score;
     }
     da.SubmitChanges();
     return true;
 }