protected void Page_Load(object sender, EventArgs e) { if (Session["loginModel"] == null) { Response.Write("<script>alert('请重新登录');opener.top.location.href='../../Default.aspx';window.close();</script>"); return; } id = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["id"])); rescuePatientRecordsModel = new RescuePatientRecordsModel(); rescuePatientRecordsBLL = new RescuePatientRecordsBLL(); rescuePatientRecordsModel = rescuePatientRecordsBLL.GetModelById(id); StudentsRealName.Text = rescuePatientRecordsModel.StudentsRealName.ToString(); TrainingBaseName.Text = rescuePatientRecordsModel.TrainingBaseName.ToString(); ProfessionalBaseName.Text = rescuePatientRecordsModel.ProfessionalBaseName.ToString(); RotaryDept.SelectedItem.Text = rescuePatientRecordsModel.DeptName.ToString(); RotaryDept.SelectedValue = rescuePatientRecordsModel.DeptCode.ToString(); Teacher.SelectedItem.Text = rescuePatientRecordsModel.TeacherName.ToString(); Teacher.SelectedItem.Value = rescuePatientRecordsModel.TeacherId.ToString(); PatientName.Text = rescuePatientRecordsModel.PatientName.ToString(); CaseId.Text = rescuePatientRecordsModel.CaseId.ToString(); DiseaseName.Text = rescuePatientRecordsModel.DiseaseName.ToString(); Condition.Text = rescuePatientRecordsModel.Condition.ToString(); RescueMeasure.Text = rescuePatientRecordsModel.RescueMeasure.ToString(); Comment.Text = rescuePatientRecordsModel.Comment.ToString(); Writor.Text = rescuePatientRecordsModel.Writor.ToString(); RegisterDate.Text = rescuePatientRecordsModel.RegisterDate.ToString(); }
public bool UpdateCheckByTeacher(RescuePatientRecordsModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update GP_RescuePatientRecords set "); strSql.Append("TeacherCheck=@TeacherCheck"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@TeacherCheck", SqlDbType.NVarChar, 50), new SqlParameter("@Id", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.TeacherCheck; parameters[1].Value = model.Id; int rows = db.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public List <Model.RescuePatientRecordsModel> GetPagedList(string StudentsName, string TrainingBaseCode, string DeptName, string PatientName, string CaseId, string DiseaseName, string Condition, int start, int end) { string sql = "select * from (select row_number() over(order by RegisterDate desc) as num,* from GP_RescuePatientRecords where StudentsName='" + StudentsName + "' and TrainingBaseCode='" + TrainingBaseCode + "'"; if (!string.IsNullOrEmpty(DeptName)) { sql += "and DeptName like '%" + DeptName + "%'"; } if (!string.IsNullOrEmpty(PatientName)) { sql += "and PatientName like '%" + PatientName + "%'"; } if (!string.IsNullOrEmpty(CaseId)) { sql += "and CaseId like '%" + CaseId + "%'"; } if (!string.IsNullOrEmpty(DiseaseName)) { sql += "and DiseaseName like '%" + DiseaseName + "%'"; } if (!string.IsNullOrEmpty(Condition)) { sql += "and Condition like '%" + Condition + "%'"; } sql += ")as t where t.num>=@start and t.num<=@end"; SqlParameter[] pars = { new SqlParameter("@start", SqlDbType.Int), new SqlParameter("@end", SqlDbType.Int) }; pars[0].Value = start; pars[1].Value = end; DataTable dt = db.RunDataTable(sql, pars); List <RescuePatientRecordsModel> list = null; if (dt.Rows.Count > 0) { list = new List <RescuePatientRecordsModel>(); RescuePatientRecordsModel model = null; foreach (DataRow row in dt.Rows) { model = new RescuePatientRecordsModel(); model = DataRowToModel(row); list.Add(model); } } return(list); }
public RescuePatientRecordsModel GetModelById(string Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 Id,StudentsRealName,StudentsName,TrainingBaseCode,TrainingBaseName,ProfessionalBaseCode,ProfessionalBaseName,DeptCode,DeptName,RegisterDate,Writor,TeacherCheck,KzrCheck,BaseCheck,ManagerCheck,PatientName,CaseId,DiseaseName,RescueMeasure,Condition,Comment,TeacherId,TeacherName from GP_RescuePatientRecords "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.NVarChar, 50) }; parameters[0].Value = Id; RescuePatientRecordsModel model = new RescuePatientRecordsModel(); DataSet ds = db.RunDataSet(strSql.ToString(), parameters, "tbName"); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["loginModel"] == null) { Response.Write("<script>alert('请重新登录');opener.top.location.href='../../Default.aspx';window.close();</script>"); return; } id = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["id"])); pi = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["pi"])); if (!IsPostBack) { loginModel = new LoginModel(); studentsPersonalInformationModel = new StudentsPersonalInformation2Model(); studentsPersonalInformationBLL = new StudentsPersonalInformation2BLL(); dt = new DataTable(); professionalBaseDeptBLL = new ProfessionalBaseDeptBLL(); loginModel = (LoginModel)Session["loginModel"]; Writor.Text = loginModel.real_name; StudentsRealName.Text = loginModel.real_name; StudentsRealName.ReadOnly = true; RegisterDate.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); RegisterDate.ReadOnly = true; na = loginModel.name; StudentsName.Value = na; tbcode = loginModel.training_base_code; studentsPersonalInformationModel = studentsPersonalInformationBLL.GetModelByNameTBCode(na, tbcode); if (studentsPersonalInformationModel == null) { Response.Write("<script> alert('请完善个人基本信息');window.close();</script>"); return; } else { TrainingBaseCode.Value = studentsPersonalInformationModel.TrainingBaseCode.ToString(); TrainingBaseName.Text = studentsPersonalInformationModel.TrainingBaseName.ToString(); TrainingBaseName.ReadOnly = true; ProfessionalBaseCode.Value = studentsPersonalInformationModel.ProfessionalBaseCode.ToString(); ProfessionalBaseName.Text = studentsPersonalInformationModel.ProfessionalBaseName.ToString(); ProfessionalBaseName.ReadOnly = true; dt = professionalBaseDeptBLL.GetDeptDataTableByCode(studentsPersonalInformationModel.ProfessionalBaseCode.ToString()); RotaryDept.DataSource = dt; RotaryDept.DataTextField = "dept_name"; RotaryDept.DataValueField = "dept_code"; RotaryDept.DataBind(); RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0")); } if (!string.IsNullOrEmpty(id)) {//如果不是表单提交,并且带了id值来做修改操作,则在界面上把值都呈现出来 rescuePatientRecordsModel = new RescuePatientRecordsModel(); rescuePatientRecordsBLL = new RescuePatientRecordsBLL(); rescuePatientRecordsModel = rescuePatientRecordsBLL.GetModelById(id); StudentsRealName.Text = rescuePatientRecordsModel.StudentsRealName.ToString(); TrainingBaseName.Text = rescuePatientRecordsModel.TrainingBaseName.ToString(); ProfessionalBaseName.Text = rescuePatientRecordsModel.ProfessionalBaseName.ToString(); //RotaryDept.SelectedItem.Text = rescuePatientRecordsModel.DeptName.ToString(); RotaryDept.SelectedValue = rescuePatientRecordsModel.DeptCode.ToString(); //RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0")); dt = new LoginBLL().GetTeachersDtByDeptCode(rescuePatientRecordsModel.TrainingBaseCode, rescuePatientRecordsModel.ProfessionalBaseCode, rescuePatientRecordsModel.DeptCode, "teachers"); Teacher.DataSource = dt; Teacher.DataTextField = "real_name"; Teacher.DataValueField = "name"; Teacher.DataBind(); Teacher.Items.Insert(0, new ListItem("==请选择==", "0")); Teacher.SelectedValue = rescuePatientRecordsModel.TeacherId; //Teacher.SelectedItem.Text = rescuePatientRecordsModel.TeacherName.ToString(); //Teacher.SelectedItem.Value = rescuePatientRecordsModel.TeacherId.ToString(); PatientName.Text = rescuePatientRecordsModel.PatientName.ToString(); CaseId.Text = rescuePatientRecordsModel.CaseId.ToString(); DiseaseName.Text = rescuePatientRecordsModel.DiseaseName.ToString(); Condition.Text = rescuePatientRecordsModel.Condition.ToString(); RescueMeasure.Text = rescuePatientRecordsModel.RescueMeasure.ToString(); Comment.Text = rescuePatientRecordsModel.Comment.ToString(); Writor.Text = rescuePatientRecordsModel.Writor.ToString(); RegisterDate.Text = rescuePatientRecordsModel.RegisterDate.ToString(); } } }
protected void save_Click(object sender, EventArgs e) { rescuePatientRecordsModel = new RescuePatientRecordsModel(); rescuePatientRecordsBLL = new RescuePatientRecordsBLL(); rescuePatientRecordsModel.DeptCode = CommonFunc.FilterSpecialString(RotaryDept.SelectedItem.Value); rescuePatientRecordsModel.DeptName = CommonFunc.FilterSpecialString(RotaryDept.SelectedItem.Text); rescuePatientRecordsModel.TeacherId = CommonFunc.FilterSpecialString(Teacher.SelectedItem.Value); rescuePatientRecordsModel.TeacherName = CommonFunc.FilterSpecialString(Teacher.SelectedItem.Text); rescuePatientRecordsModel.PatientName = CommonFunc.FilterSpecialString(PatientName.Text); rescuePatientRecordsModel.CaseId = CommonFunc.FilterSpecialString(CaseId.Text); rescuePatientRecordsModel.DiseaseName = CommonFunc.FilterSpecialString(DiseaseName.Text); rescuePatientRecordsModel.Condition = CommonFunc.FilterSpecialString(Condition.Text); rescuePatientRecordsModel.RescueMeasure = CommonFunc.FilterSpecialString(RescueMeasure.Text); rescuePatientRecordsModel.Comment = CommonFunc.FilterSpecialString(Comment.Text); rescuePatientRecordsModel.Writor = CommonFunc.FilterSpecialString(Writor.Text); rescuePatientRecordsModel.RegisterDate = CommonFunc.FilterSpecialString(RegisterDate.Text); if (string.IsNullOrEmpty(id)) { id = Guid.NewGuid().ToString(); rescuePatientRecordsModel.Id = id; rescuePatientRecordsModel.StudentsName = StudentsName.Value.ToString(); rescuePatientRecordsModel.StudentsRealName = CommonFunc.FilterSpecialString(StudentsRealName.Text.Trim()); rescuePatientRecordsModel.TrainingBaseCode = CommonFunc.FilterSpecialString(TrainingBaseCode.Value); rescuePatientRecordsModel.TrainingBaseName = CommonFunc.FilterSpecialString(TrainingBaseName.Text); rescuePatientRecordsModel.ProfessionalBaseCode = CommonFunc.FilterSpecialString(ProfessionalBaseCode.Value); rescuePatientRecordsModel.ProfessionalBaseName = CommonFunc.FilterSpecialString(ProfessionalBaseName.Text); rescuePatientRecordsModel.TeacherCheck = teacher_check; rescuePatientRecordsModel.KzrCheck = kzr_check; rescuePatientRecordsModel.BaseCheck = base_check; rescuePatientRecordsModel.ManagerCheck = manager_check; if (rescuePatientRecordsModel.DeptCode == "0" || rescuePatientRecordsModel.DeptName == "==请选择==") { ShowMessageBox.Showmessagebox(this, "轮转科室不能为空", null); return; } if (rescuePatientRecordsModel.TeacherId == "0" || rescuePatientRecordsModel.TeacherName == "==请选择==") { ShowMessageBox.Showmessagebox(this, "指导医师不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.PatientName)) { ShowMessageBox.Showmessagebox(this, "病人姓名不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.CaseId)) { ShowMessageBox.Showmessagebox(this, "病历号不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.DiseaseName)) { ShowMessageBox.Showmessagebox(this, "疾病名称不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.Condition)) { ShowMessageBox.Showmessagebox(this, "转归情况不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.RescueMeasure)) { ShowMessageBox.Showmessagebox(this, "治疗措施不能为空", null); return; } if (rescuePatientRecordsModel.RescueMeasure.Length > 1000) { ShowMessageBox.Showmessagebox(this, "治疗措施字数不能超过1000字", null); return; } if (rescuePatientRecordsModel.Comment.Length > 1000) { ShowMessageBox.Showmessagebox(this, "备注字数不能超过1000字", null); return; } if (rescuePatientRecordsBLL.Add(rescuePatientRecordsModel)) { try { Response.Write("<script language='javascript'> alert('抢救病人记录信息添加成功');window.opener.parent.frames.bodyFrame.frames.frmright.window.loadPageList(1);window.close();</script>"); } catch (Exception ex) { Response.Write(ex.Message); } } } else { if (rescuePatientRecordsModel.DeptCode == "0" || rescuePatientRecordsModel.DeptName == "==请选择==") { ShowMessageBox.Showmessagebox(this, "轮转科室不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.PatientName)) { ShowMessageBox.Showmessagebox(this, "病人姓名不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.CaseId)) { ShowMessageBox.Showmessagebox(this, "病历号不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.DiseaseName)) { ShowMessageBox.Showmessagebox(this, "疾病名称不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.Condition)) { ShowMessageBox.Showmessagebox(this, "转归情况不能为空", null); return; } if (string.IsNullOrEmpty(rescuePatientRecordsModel.RescueMeasure)) { ShowMessageBox.Showmessagebox(this, "治疗措施不能为空", null); return; } if (rescuePatientRecordsModel.RescueMeasure.Length > 1000) { ShowMessageBox.Showmessagebox(this, "治疗措施字数不能超过1000字", null); return; } if (rescuePatientRecordsModel.Comment.Length > 1000) { ShowMessageBox.Showmessagebox(this, "备注字数不能超过1000字", null); return; } if (rescuePatientRecordsBLL.Update(rescuePatientRecordsModel, id)) { try { Response.Write("<script language='javascript'> alert('抢救病人记录信息修改成功');window.opener.window.loadPageList('" + pi + "');window.close();</script>"); } catch (Exception ex) { Response.Write(ex.Message); } } } }
public bool UpdateCheckByTeacher(RescuePatientRecordsModel model) { return(rescurePatientRecordsDAL.UpdateCheckByTeacher(model)); }
public bool Update(RescuePatientRecordsModel model, string id) { return(rescurePatientRecordsDAL.Update(model, id)); }
public bool Add(RescuePatientRecordsModel model) { return(rescurePatientRecordsDAL.Add(model)); }
public bool Update(RescuePatientRecordsModel model, string id) { StringBuilder strSql = new StringBuilder(); strSql.Append("update GP_RescuePatientRecords set "); strSql.Append("DeptCode=@DeptCode,"); strSql.Append("DeptName=@DeptName,"); strSql.Append("RegisterDate=@RegisterDate,"); strSql.Append("Writor=@Writor,"); strSql.Append("PatientName=@PatientName,"); strSql.Append("CaseId=@CaseId,"); strSql.Append("DiseaseName=@DiseaseName,"); strSql.Append("RescueMeasure=@RescueMeasure,"); strSql.Append("Condition=@Condition,"); strSql.Append("Comment=@Comment,"); strSql.Append("TeacherId=@TeacherId,"); strSql.Append("TeacherName=@TeacherName"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@DeptCode", SqlDbType.NVarChar, 50), new SqlParameter("@DeptName", SqlDbType.NVarChar, 500), new SqlParameter("@RegisterDate", SqlDbType.NVarChar, 50), new SqlParameter("@Writor", SqlDbType.NVarChar, 50), new SqlParameter("@PatientName", SqlDbType.NVarChar, 50), new SqlParameter("@CaseId", SqlDbType.NVarChar, 50), new SqlParameter("@DiseaseName", SqlDbType.NVarChar, 500), new SqlParameter("@RescueMeasure", SqlDbType.NVarChar, 500), new SqlParameter("@Condition", SqlDbType.NVarChar, 50), new SqlParameter("@Comment", SqlDbType.NVarChar, 1000), new SqlParameter("@TeacherId", SqlDbType.NVarChar, 50), new SqlParameter("@TeacherName", SqlDbType.NVarChar, 50), new SqlParameter("@Id", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.DeptCode; parameters[1].Value = model.DeptName; parameters[2].Value = model.RegisterDate; parameters[3].Value = model.Writor; parameters[4].Value = model.PatientName; parameters[5].Value = model.CaseId; parameters[6].Value = model.DiseaseName; parameters[7].Value = model.RescueMeasure; parameters[8].Value = model.Condition; parameters[9].Value = model.Comment; parameters[10].Value = model.TeacherId; parameters[11].Value = model.TeacherName; parameters[12].Value = id; int rows = db.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public bool Add(RescuePatientRecordsModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into GP_RescuePatientRecords("); strSql.Append("Id,StudentsRealName,StudentsName,TrainingBaseCode,TrainingBaseName,ProfessionalBaseCode,ProfessionalBaseName,DeptCode,DeptName,RegisterDate,Writor,TeacherCheck,KzrCheck,BaseCheck,ManagerCheck,PatientName,CaseId,DiseaseName,RescueMeasure,Condition,Comment,TeacherId,TeacherName)"); strSql.Append(" values ("); strSql.Append("@Id,@StudentsRealName,@StudentsName,@TrainingBaseCode,@TrainingBaseName,@ProfessionalBaseCode,@ProfessionalBaseName,@DeptCode,@DeptName,@RegisterDate,@Writor,@TeacherCheck,@KzrCheck,@BaseCheck,@ManagerCheck,@PatientName,@CaseId,@DiseaseName,@RescueMeasure,@Condition,@Comment,@TeacherId,@TeacherName)"); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.NVarChar, 50), new SqlParameter("@StudentsRealName", SqlDbType.NVarChar, 50), new SqlParameter("@StudentsName", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseCode", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseName", SqlDbType.NVarChar, 50), new SqlParameter("@ProfessionalBaseCode", SqlDbType.NVarChar, 50), new SqlParameter("@ProfessionalBaseName", SqlDbType.NVarChar, 50), new SqlParameter("@DeptCode", SqlDbType.NVarChar, 50), new SqlParameter("@DeptName", SqlDbType.NVarChar, 500), new SqlParameter("@RegisterDate", SqlDbType.NVarChar, 50), new SqlParameter("@Writor", SqlDbType.NVarChar, 50), new SqlParameter("@TeacherCheck", SqlDbType.NVarChar, 50), new SqlParameter("@KzrCheck", SqlDbType.NVarChar, 50), new SqlParameter("@BaseCheck", SqlDbType.NVarChar, 50), new SqlParameter("@ManagerCheck", SqlDbType.NVarChar, 50), new SqlParameter("@PatientName", SqlDbType.NVarChar, 50), new SqlParameter("@CaseId", SqlDbType.NVarChar, 50), new SqlParameter("@DiseaseName", SqlDbType.NVarChar, 500), new SqlParameter("@RescueMeasure", SqlDbType.NVarChar, 500), new SqlParameter("@Condition", SqlDbType.NVarChar, 50), new SqlParameter("@Comment", SqlDbType.NVarChar, 1000), new SqlParameter("@TeacherId", SqlDbType.NVarChar, 50), new SqlParameter("@TeacherName", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.Id; parameters[1].Value = model.StudentsRealName; parameters[2].Value = model.StudentsName; parameters[3].Value = model.TrainingBaseCode; parameters[4].Value = model.TrainingBaseName; parameters[5].Value = model.ProfessionalBaseCode; parameters[6].Value = model.ProfessionalBaseName; parameters[7].Value = model.DeptCode; parameters[8].Value = model.DeptName; parameters[9].Value = model.RegisterDate; parameters[10].Value = model.Writor; parameters[11].Value = model.TeacherCheck; parameters[12].Value = model.KzrCheck; parameters[13].Value = model.BaseCheck; parameters[14].Value = model.ManagerCheck; parameters[15].Value = model.PatientName; parameters[16].Value = model.CaseId; parameters[17].Value = model.DiseaseName; parameters[18].Value = model.RescueMeasure; parameters[19].Value = model.Condition; parameters[20].Value = model.Comment; parameters[21].Value = model.TeacherId; parameters[22].Value = model.TeacherName; int rows = db.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public RescuePatientRecordsModel DataRowToModel(DataRow row) { RescuePatientRecordsModel model = new RescuePatientRecordsModel(); if (row != null) { if (row["Id"] != null) { model.Id = row["Id"].ToString(); } if (row["StudentsRealName"] != null) { model.StudentsRealName = row["StudentsRealName"].ToString(); } if (row["StudentsName"] != null) { model.StudentsName = row["StudentsName"].ToString(); } if (row["TrainingBaseCode"] != null) { model.TrainingBaseCode = row["TrainingBaseCode"].ToString(); } if (row["TrainingBaseName"] != null) { model.TrainingBaseName = row["TrainingBaseName"].ToString(); } if (row["ProfessionalBaseCode"] != null) { model.ProfessionalBaseCode = row["ProfessionalBaseCode"].ToString(); } if (row["ProfessionalBaseName"] != null) { model.ProfessionalBaseName = row["ProfessionalBaseName"].ToString(); } if (row["DeptCode"] != null) { model.DeptCode = row["DeptCode"].ToString(); } if (row["DeptName"] != null) { model.DeptName = row["DeptName"].ToString(); } if (row["RegisterDate"] != null) { model.RegisterDate = row["RegisterDate"].ToString(); } if (row["Writor"] != null) { model.Writor = row["Writor"].ToString(); } if (row["TeacherCheck"] != null) { model.TeacherCheck = row["TeacherCheck"].ToString(); } if (row["KzrCheck"] != null) { model.KzrCheck = row["KzrCheck"].ToString(); } if (row["BaseCheck"] != null) { model.BaseCheck = row["BaseCheck"].ToString(); } if (row["ManagerCheck"] != null) { model.ManagerCheck = row["ManagerCheck"].ToString(); } if (row["PatientName"] != null) { model.PatientName = row["PatientName"].ToString(); } if (row["CaseId"] != null) { model.CaseId = row["CaseId"].ToString(); } if (row["DiseaseName"] != null) { model.DiseaseName = row["DiseaseName"].ToString(); } if (row["RescueMeasure"] != null) { model.RescueMeasure = row["RescueMeasure"].ToString(); } if (row["Condition"] != null) { model.Condition = row["Condition"].ToString(); } if (row["Comment"] != null) { model.Comment = row["Comment"].ToString(); } if (row["TeacherId"] != null) { model.TeacherId = row["TeacherId"].ToString(); } if (row["TeacherName"] != null) { model.TeacherName = row["TeacherName"].ToString(); } } return(model); }