public frmAddProData(string path, ProgramAnswer pa) { InitializeComponent(); Path = path; rtbInput.Text = pa.Input; rtbOutput.Text = pa.Output; Result = false; }
public frmAddAnswer(int Count,ProgramAnswer PA) { InitializeComponent(); Result = false; cbNum.Items.Clear(); for (int i = 0; i < Count; i++) { cbNum.Items.Add(i + 1); } ProAns=PA; PA.Input = "-"; rtbAnswer.Text = PA.Output; cbNum.SelectedIndex = PA.SeqNum-1; }
private void btnOK_Click(object sender, EventArgs e) { Result = true; ProAns = new ProgramAnswer(0, rtbInput.Text, rtbOutput.Text); this.Close(); }
private List<ProgramAnswer> DataSetToListProgramAnswer(DataSet Ds) { DataTable p_Data = Ds.Tables[0]; List<ProgramAnswer> res = new List<ProgramAnswer>(); for (int i = 0; i < p_Data.Rows.Count; i++) { ProgramAnswer tmp = new ProgramAnswer(); tmp.PID = Convert.ToInt32(p_Data.Rows[i]["PID"]); tmp.AID = Convert.ToInt32(p_Data.Rows[i]["AID"]); tmp.Input = p_Data.Rows[i]["Input"].ToString(); tmp.Output = p_Data.Rows[i]["Output"].ToString(); tmp.SeqNum = Convert.ToInt32(p_Data.Rows[i]["SeqNum"]); res.Add(tmp); } return res; }
private void btnOK_Click(object sender, EventArgs e) { Result = true; ProAns = new ProgramAnswer(Convert.ToInt32(cbNum.SelectedItem), "", rtbAnswer.Text); this.Close(); }