protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { string strId = Request.QueryString.Get("id"); if (strId != null && strId != "") { ViewState["UpdateID"] = strId; ExamResultUpdateBLL eruBll = new ExamResultUpdateBLL(); ExamResultUpdate examResultUpdate = eruBll.GetExamResultUpdate(int.Parse(strId)); if (examResultUpdate != null) { this.lblExamineeName.Text = examResultUpdate.EmployeeName; this.LabelExamName.Text = examResultUpdate.ExamName; this.TextBoxCause.Text = examResultUpdate.updateCause; this.LabelTime.Text = examResultUpdate.updateDate.ToString("yyyy-MM-dd");; this.LabelWorkMan.Text = examResultUpdate.updatePerson; this.TextBoxRemark.Text = examResultUpdate.Memo; this.LabelNewScore.Text = examResultUpdate.newScore.ToString() + "ио"; this.LabelOldScore.Text = examResultUpdate.oldScore.ToString() + "ио"; } } string strmode = Request.QueryString.Get("mode"); if (strmode != null && strmode == "ReadOnly") { this.btnsave.Visible = false; } } }
public ExamResultUpdate GetExamResultUpdate(int ExamResultUpdateId) { ExamResultUpdate examResultUpdate = null; Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "USP_exam_result_update_G"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "p_exam_result_update_id", DbType.Int32, ExamResultUpdateId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { if (dataReader.Read()) { examResultUpdate = CreateModelObject(dataReader); } } return(examResultUpdate); }