/// <summary> /// 添加ExamAnswerEstimate表行数据(如主键为非自增型字段,则自行修改代码) /// </summary> /// <param name="examanswerestimatedata">数据集对象</param> /// <param name="examanswerestimate">实体对象</param> public void AddRow(ref ExamAnswerEstimateData examanswerestimatedata, EntityExamAnswerEstimate examanswerestimate) { #region DataRow dr = examanswerestimatedata.Tables[0].NewRow(); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.answerId, examanswerestimate.answerId); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.questionId, examanswerestimate.questionId); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.answer, examanswerestimate.answer); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.writeUser, examanswerestimate.writeUser); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.writeIp, examanswerestimate.writeIp); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.writeTime, examanswerestimate.writeTime); examanswerestimatedata.Tables[0].Rows.Add(dr); #endregion }
/// <summary> /// 编辑examanswerestimatedata数据集中指定的行数据 /// </summary> /// <param name="examanswerestimatedata">数据集对象</param> /// <param name="examanswerestimate">实体对象</param> public void EditRow(ref ExamAnswerEstimateData examanswerestimatedata, EntityExamAnswerEstimate examanswerestimate) { #region if (examanswerestimatedata.Tables[0].Rows.Count <= 0) { examanswerestimatedata = this.GetData(examanswerestimate.answerId); } DataRow dr = examanswerestimatedata.Tables[0].Rows.Find(new object[1] { examanswerestimate.answerId }); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.answerId, examanswerestimate.answerId); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.questionId, examanswerestimate.questionId); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.answer, examanswerestimate.answer); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.writeUser, examanswerestimate.writeUser); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.writeIp, examanswerestimate.writeIp); examanswerestimatedata.Assign(dr, ExamAnswerEstimateData.writeTime, examanswerestimate.writeTime); #endregion }