本文整理汇总了C#中Question.Get_Answer方法的典型用法代码示例。如果您正苦于以下问题:C# Question.Get_Answer方法的具体用法?C# Question.Get_Answer怎么用?C# Question.Get_Answer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question.Get_Answer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Edit
public void Edit(Question item, int pos)
{
DB.Tables[0].Rows[pos]["question"] = item.Question_;
DB.Tables[0].Rows[pos]["trueAnswer"] = item.Get_true_answer();
DB.Tables[0].Rows[pos]["answer2"] = item.Get_Answer(1);
DB.Tables[0].Rows[pos]["answer3"] = item.Get_Answer(2);
DB.Tables[0].Rows[pos]["answer4"] = item.Get_Answer(3);
Save();
}
示例2: Add
public void Add(Question item)
{
DataRow row = DB.Tables[0].NewRow();
row["id"] = DB.Tables[0].Rows.Count;
row["question"] = item.Question_;
row["trueAnswer"] = item.Get_true_answer();
row["answer2"] = item.Get_Answer(1);
row["answer3"] = item.Get_Answer(2);
row["answer4"] = item.Get_Answer(3);
DB.Tables[0].Rows.Add(row);
Save();
}
示例3: Add
public void Add(Question item)
{
string Expression = string.Format("INSERT INTO mainTable (question, trueAnswer, answer2, answer3, answer4) values ('{0}', '{1}', '{2}', '{3}', '{4}')",
item.Question_, item.Get_Answer(0), item.Get_Answer(1), item.Get_Answer(2), item.Get_Answer(3));
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand(Expression, connection);
int num = command.ExecuteNonQuery();
}
Load(_list);
}
示例4: Edit
public void Edit(Question item, int pos)
{
_list[pos].Question_ = item.Question_;
for (int i = 0; i < 4; i++)
_list[pos].Set_Answer(i, item.Get_Answer(i));
}
示例5: Edit
public void Edit(Question item, int pos)
{
int num;
string ExpU = string.Format("update mainTable set question = '{0}', trueAnswer = '{1}', answer2 = '{2}', answer3 = '{3}', answer4 = '{4}' where question like '{4}'",
item.Question_, item.Get_Answer(0), item.Get_Answer(1), item.Get_Answer(2), item.Get_Answer(3), _list[pos].Question_);
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand(ExpU, connection);
num = command.ExecuteNonQuery();
if(num == 0)
throw new Exception(num + " items updated");
}
Load(_list);
}
示例6: SetNewQuestion
public void SetNewQuestion(Question item)
{
_LastClick.Image = million.Properties.Resources.button;
_answers_name[Convert.ToInt32(_LastClick.Name[_LastClick.Name.Length - 1].ToString()) - 1].Image = million.Properties.Resources.button;
friend.Visible = false;
friend_answer.Visible = false;
layer_auditory.Visible = false;
QUESTION.Text = item.Question_;
for (int i = 0; i < 4; i++)
{
_answers[i].Text = item.Get_Answer(i);
if (_fify_fifty)
_answers_name[i].Visible = true;
}
_fify_fifty_used = false;
_clicked = false;
}