public Model.StudentsPersonalInformation2Model GetModelById(string id) { string sql = string.Format("select * from GP_StudentsPersonalInformation2 where Id=@Id"); SqlParameter[] prams = { db.MakeInParam("@Id", SqlDbType.NVarChar, 50, id) }; DataTable dt = db.RunDataTable(sql, prams); StudentsPersonalInformation2Model studentsPersonalInformationModel = new StudentsPersonalInformation2Model(); studentsPersonalInformationModel = (StudentsPersonalInformation2Model)ConvertTo.convertToModel(dt, studentsPersonalInformationModel); return(studentsPersonalInformationModel); }
public Model.StudentsPersonalInformation2Model GetModelByNameTBCode(string Name, string TrainingBaseCode) { string sql = string.Format("select * from GP_StudentsPersonalInformation2 where Name=@Name and TrainingBaseCode=@TrainingBaseCode"); SqlParameter[] prams = { db.MakeInParam("@Name", SqlDbType.NVarChar, 50, Name), db.MakeInParam("@TrainingBaseCode", SqlDbType.NVarChar, 50, TrainingBaseCode) }; DataTable dt = db.RunDataTable(sql, prams); StudentsPersonalInformation2Model studentsPersonalInformationModel = new StudentsPersonalInformation2Model(); studentsPersonalInformationModel = (StudentsPersonalInformation2Model)ConvertTo.convertToModel(dt, studentsPersonalInformationModel); return(studentsPersonalInformationModel); }
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.SafeGetStringFromObj(Request.QueryString["id"]); if (!IsPostBack) { studentsPersonalInformationModel = new StudentsPersonalInformation2Model(); studentsPersonalInformationBLL = new StudentsPersonalInformation2BLL(); studentsPersonalInformationModel = studentsPersonalInformationBLL.GetModelById(id); real_name.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.RealName); sex.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.Sex); id_number.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.IdNumber); datebirth.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.DateBirth); telephon.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.Telephon); mail.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.Mail); minzu.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.MinZu); bk_school.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.BkSchool); bk_major.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.BkMajor); graduation_time.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.GraduationTime); high_education.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.HighEducation); high_school.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.HighSchool); high_major.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.HighMajor); high_education_time.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.HighEducationTime); identity_type.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.IdentityType); send_unit.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.SendUnit); training_base_name.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.TrainingBaseName); collaborative_unit.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.CollaborativeUnit); professional_base_name.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.ProfessionalBaseName); training_time.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.TrainingTime); plan_training_time.Text = CommonFunc.SafeGetStringFromObj(studentsPersonalInformationModel.PlanTrainingTime); image_path.Value = studentsPersonalInformationModel.ImagePath == null ? "" : studentsPersonalInformationModel.ImagePath.ToString(); } }
public StudentsPersonalInformation2Model DataRowToModel(DataRow row) { StudentsPersonalInformation2Model model = new StudentsPersonalInformation2Model(); if (row != null) { if (row["Id"] != null) { model.Id = row["Id"].ToString(); } if (row["Name"] != null) { model.Name = row["Name"].ToString(); } if (row["RealName"] != null) { model.RealName = row["RealName"].ToString(); } if (row["ImagePath"] != null) { model.ImagePath = row["ImagePath"].ToString(); } if (row["Sex"] != null) { model.Sex = row["Sex"].ToString(); } if (row["IdNumber"] != null) { model.IdNumber = row["IdNumber"].ToString(); } if (row["DateBirth"] != null) { model.DateBirth = row["DateBirth"].ToString(); } if (row["MinZu"] != null) { model.MinZu = row["MinZu"].ToString(); } if (row["Telephon"] != null) { model.Telephon = row["Telephon"].ToString(); } if (row["Mail"] != null) { model.Mail = row["Mail"].ToString(); } if (row["BkSchool"] != null) { model.BkSchool = row["BkSchool"].ToString(); } if (row["BkMajor"] != null) { model.BkMajor = row["BkMajor"].ToString(); } if (row["GraduationTime"] != null) { model.GraduationTime = row["GraduationTime"].ToString(); } if (row["HighEducation"] != null) { model.HighEducation = row["HighEducation"].ToString(); } if (row["HighSchool"] != null) { model.HighSchool = row["HighSchool"].ToString(); } if (row["HighMajor"] != null) { model.HighMajor = row["HighMajor"].ToString(); } if (row["HighEducationTime"] != null) { model.HighEducationTime = row["HighEducationTime"].ToString(); } if (row["IdentityType"] != null) { model.IdentityType = row["IdentityType"].ToString(); } if (row["SendUnit"] != null) { model.SendUnit = row["SendUnit"].ToString(); } if (row["TrainingBaseProvinceCode"] != null) { model.TrainingBaseProvinceCode = row["TrainingBaseProvinceCode"].ToString(); } if (row["TrainingBaseProvinceName"] != null) { model.TrainingBaseProvinceName = row["TrainingBaseProvinceName"].ToString(); } if (row["TrainingBaseCode"] != null) { model.TrainingBaseCode = row["TrainingBaseCode"].ToString(); } if (row["TrainingBaseName"] != null) { model.TrainingBaseName = row["TrainingBaseName"].ToString(); } if (row["CollaborativeUnit"] != null) { model.CollaborativeUnit = row["CollaborativeUnit"].ToString(); } if (row["ProfessionalBaseCode"] != null) { model.ProfessionalBaseCode = row["ProfessionalBaseCode"].ToString(); } if (row["ProfessionalBaseName"] != null) { model.ProfessionalBaseName = row["ProfessionalBaseName"].ToString(); } if (row["TrainingTime"] != null) { model.TrainingTime = row["TrainingTime"].ToString(); } if (row["PlanTrainingTime"] != null) { model.PlanTrainingTime = row["PlanTrainingTime"].ToString(); } if (row["Tag1"] != null) { model.Tag1 = row["Tag1"].ToString(); } if (row["Tag2"] != null) { model.Tag2 = row["Tag2"].ToString(); } if (row["Tag3"] != null) { model.Tag3 = row["Tag3"].ToString(); } } return(model); }
public List <Model.StudentsPersonalInformation2Model> CommonGetPagedList(string TrainingBaseCode, string ProfessionalBaseCode, string StudentsRealName, string Sex, string MinZu, string HighEducation, string HighSchool, string IdentityType, string SendUnit, string CollaborativeUnit, string TrainingTime, string PlanTrainingTime, int start, int end) { string sql = "select * from (select row_number() over(order by TrainingTime desc) as num,* from GP_StudentsPersonalInformation2 where TrainingBaseCode like '%" + TrainingBaseCode + "%'"; if (!string.IsNullOrEmpty(ProfessionalBaseCode)) { sql += "and ProfessionalBaseCode like '%" + ProfessionalBaseCode + "%'"; } if (!string.IsNullOrEmpty(StudentsRealName)) { sql += "and RealName like '%" + StudentsRealName + "%'"; } if (!string.IsNullOrEmpty(Sex)) { sql += "and Sex ='" + Sex + "'"; } if (!string.IsNullOrEmpty(MinZu)) { sql += "and MinZu like '%" + MinZu + "%'"; } if (!string.IsNullOrEmpty(HighEducation)) { sql += "and HighEducation like '%" + HighEducation + "%'"; } if (!string.IsNullOrEmpty(HighSchool)) { sql += "and HighSchool like '%" + HighSchool + "%'"; } if (!string.IsNullOrEmpty(IdentityType)) { sql += "and IdentityType like '%" + IdentityType + "%'"; } if (!string.IsNullOrEmpty(SendUnit)) { sql += "and SendUnit = '" + SendUnit + "'"; } if (!string.IsNullOrEmpty(CollaborativeUnit)) { sql += "and CollaborativeUnit like '%" + CollaborativeUnit + "%'"; } if (!string.IsNullOrEmpty(TrainingTime)) { sql += "and TrainingTime like '%" + TrainingTime + "%'"; } if (!string.IsNullOrEmpty(PlanTrainingTime)) { sql += "and PlanTrainingTime = '" + PlanTrainingTime + "'"; } 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 <StudentsPersonalInformation2Model> list = null; if (dt.Rows.Count > 0) { list = new List <StudentsPersonalInformation2Model>(); StudentsPersonalInformation2Model model = null; foreach (DataRow row in dt.Rows) { model = new StudentsPersonalInformation2Model(); model = DataRowToModel(row); list.Add(model); } } return(list); }
public bool Add(StudentsPersonalInformation2Model model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into GP_StudentsPersonalInformation2("); strSql.Append("Id,Name,RealName,ImagePath,Sex,IdNumber,DateBirth,MinZu,Telephon,Mail,BkSchool,BkMajor,GraduationTime,HighEducation,HighSchool,HighMajor,HighEducationTime,IdentityType,SendUnit,TrainingBaseProvinceCode,TrainingBaseProvinceName,TrainingBaseCode,TrainingBaseName,CollaborativeUnit,ProfessionalBaseCode,ProfessionalBaseName,TrainingTime,PlanTrainingTime,Tag1,Tag2,Tag3)"); strSql.Append(" values ("); strSql.Append("@Id,@Name,@RealName,@ImagePath,@Sex,@IdNumber,@DateBirth,@MinZu,@Telephon,@Mail,@BkSchool,@BkMajor,@GraduationTime,@HighEducation,@HighSchool,@HighMajor,@HighEducationTime,@IdentityType,@SendUnit,@TrainingBaseProvinceCode,@TrainingBaseProvinceName,@TrainingBaseCode,@TrainingBaseName,@CollaborativeUnit,@ProfessionalBaseCode,@ProfessionalBaseName,@TrainingTime,@PlanTrainingTime,@Tag1,@Tag2,@Tag3)"); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.NVarChar, 50), new SqlParameter("@Name", SqlDbType.NVarChar, 50), new SqlParameter("@RealName", SqlDbType.NVarChar, 50), new SqlParameter("@ImagePath", SqlDbType.NVarChar, 500), new SqlParameter("@Sex", SqlDbType.NVarChar, 50), new SqlParameter("@IdNumber", SqlDbType.NVarChar, 50), new SqlParameter("@DateBirth", SqlDbType.NVarChar, 50), new SqlParameter("@MinZu", SqlDbType.NVarChar, 50), new SqlParameter("@Telephon", SqlDbType.NVarChar, 50), new SqlParameter("@Mail", SqlDbType.NVarChar, 50), new SqlParameter("@BkSchool", SqlDbType.NVarChar, 50), new SqlParameter("@BkMajor", SqlDbType.NVarChar, 50), new SqlParameter("@GraduationTime", SqlDbType.NVarChar, 50), new SqlParameter("@HighEducation", SqlDbType.NVarChar, 50), new SqlParameter("@HighSchool", SqlDbType.NVarChar, 50), new SqlParameter("@HighMajor", SqlDbType.NVarChar, 50), new SqlParameter("@HighEducationTime", SqlDbType.NVarChar, 50), new SqlParameter("@IdentityType", SqlDbType.NVarChar, 50), new SqlParameter("@SendUnit", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseProvinceCode", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseProvinceName", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseCode", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseName", SqlDbType.NVarChar, 50), new SqlParameter("@CollaborativeUnit", SqlDbType.NVarChar, 50), new SqlParameter("@ProfessionalBaseCode", SqlDbType.NVarChar, 50), new SqlParameter("@ProfessionalBaseName", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingTime", SqlDbType.NVarChar, 50), new SqlParameter("@PlanTrainingTime", SqlDbType.NVarChar, 50), new SqlParameter("@Tag1", SqlDbType.NVarChar, 50), new SqlParameter("@Tag2", SqlDbType.NVarChar, 50), new SqlParameter("@Tag3", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.Id; parameters[1].Value = model.Name; parameters[2].Value = model.RealName; parameters[3].Value = model.ImagePath; parameters[4].Value = model.Sex; parameters[5].Value = model.IdNumber; parameters[6].Value = model.DateBirth; parameters[7].Value = model.MinZu; parameters[8].Value = model.Telephon; parameters[9].Value = model.Mail; parameters[10].Value = model.BkSchool; parameters[11].Value = model.BkMajor; parameters[12].Value = model.GraduationTime; parameters[13].Value = model.HighEducation; parameters[14].Value = model.HighSchool; parameters[15].Value = model.HighMajor; parameters[16].Value = model.HighEducationTime; parameters[17].Value = model.IdentityType; parameters[18].Value = model.SendUnit; parameters[19].Value = model.TrainingBaseProvinceCode; parameters[20].Value = model.TrainingBaseProvinceName; parameters[21].Value = model.TrainingBaseCode; parameters[22].Value = model.TrainingBaseName; parameters[23].Value = model.CollaborativeUnit; parameters[24].Value = model.ProfessionalBaseCode; parameters[25].Value = model.ProfessionalBaseName; parameters[26].Value = model.TrainingTime; parameters[27].Value = model.PlanTrainingTime; parameters[28].Value = model.Tag1; parameters[29].Value = model.Tag2; parameters[30].Value = model.Tag3; int rows = db.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public bool Update(StudentsPersonalInformation2Model model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update GP_StudentsPersonalInformation2 set "); strSql.Append("Name=@Name,"); strSql.Append("RealName=@RealName,"); strSql.Append("ImagePath=@ImagePath,"); strSql.Append("Sex=@Sex,"); strSql.Append("IdNumber=@IdNumber,"); strSql.Append("DateBirth=@DateBirth,"); strSql.Append("MinZu=@MinZu,"); strSql.Append("Telephon=@Telephon,"); strSql.Append("Mail=@Mail,"); strSql.Append("BkSchool=@BkSchool,"); strSql.Append("BkMajor=@BkMajor,"); strSql.Append("GraduationTime=@GraduationTime,"); strSql.Append("HighEducation=@HighEducation,"); strSql.Append("HighSchool=@HighSchool,"); strSql.Append("HighMajor=@HighMajor,"); strSql.Append("HighEducationTime=@HighEducationTime,"); strSql.Append("IdentityType=@IdentityType,"); strSql.Append("SendUnit=@SendUnit,"); strSql.Append("TrainingBaseProvinceCode=@TrainingBaseProvinceCode,"); strSql.Append("TrainingBaseProvinceName=@TrainingBaseProvinceName,"); strSql.Append("TrainingBaseCode=@TrainingBaseCode,"); strSql.Append("TrainingBaseName=@TrainingBaseName,"); strSql.Append("CollaborativeUnit=@CollaborativeUnit,"); strSql.Append("ProfessionalBaseCode=@ProfessionalBaseCode,"); strSql.Append("ProfessionalBaseName=@ProfessionalBaseName,"); strSql.Append("TrainingTime=@TrainingTime,"); strSql.Append("PlanTrainingTime=@PlanTrainingTime,"); strSql.Append("Tag1=@Tag1,"); strSql.Append("Tag2=@Tag2,"); strSql.Append("Tag3=@Tag3"); strSql.Append(" where Name=@Name "); SqlParameter[] parameters = { new SqlParameter("@Name", SqlDbType.NVarChar, 50), new SqlParameter("@RealName", SqlDbType.NVarChar, 50), new SqlParameter("@ImagePath", SqlDbType.NVarChar, 500), new SqlParameter("@Sex", SqlDbType.NVarChar, 50), new SqlParameter("@IdNumber", SqlDbType.NVarChar, 50), new SqlParameter("@DateBirth", SqlDbType.NVarChar, 50), new SqlParameter("@MinZu", SqlDbType.NVarChar, 50), new SqlParameter("@Telephon", SqlDbType.NVarChar, 50), new SqlParameter("@Mail", SqlDbType.NVarChar, 50), new SqlParameter("@BkSchool", SqlDbType.NVarChar, 50), new SqlParameter("@BkMajor", SqlDbType.NVarChar, 50), new SqlParameter("@GraduationTime", SqlDbType.NVarChar, 50), new SqlParameter("@HighEducation", SqlDbType.NVarChar, 50), new SqlParameter("@HighSchool", SqlDbType.NVarChar, 50), new SqlParameter("@HighMajor", SqlDbType.NVarChar, 50), new SqlParameter("@HighEducationTime", SqlDbType.NVarChar, 50), new SqlParameter("@IdentityType", SqlDbType.NVarChar, 50), new SqlParameter("@SendUnit", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseProvinceCode", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseProvinceName", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseCode", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingBaseName", SqlDbType.NVarChar, 50), new SqlParameter("@CollaborativeUnit", SqlDbType.NVarChar, 50), new SqlParameter("@ProfessionalBaseCode", SqlDbType.NVarChar, 50), new SqlParameter("@ProfessionalBaseName", SqlDbType.NVarChar, 50), new SqlParameter("@TrainingTime", SqlDbType.NVarChar, 50), new SqlParameter("@PlanTrainingTime", SqlDbType.NVarChar, 50), new SqlParameter("@Tag1", SqlDbType.NVarChar, 50), new SqlParameter("@Tag2", SqlDbType.NVarChar, 50), new SqlParameter("@Tag3", SqlDbType.NVarChar, 50), new SqlParameter("@Id", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.Name; parameters[1].Value = model.RealName; parameters[2].Value = model.ImagePath; parameters[3].Value = model.Sex; parameters[4].Value = model.IdNumber; parameters[5].Value = model.DateBirth; parameters[6].Value = model.MinZu; parameters[7].Value = model.Telephon; parameters[8].Value = model.Mail; parameters[9].Value = model.BkSchool; parameters[10].Value = model.BkMajor; parameters[11].Value = model.GraduationTime; parameters[12].Value = model.HighEducation; parameters[13].Value = model.HighSchool; parameters[14].Value = model.HighMajor; parameters[15].Value = model.HighEducationTime; parameters[16].Value = model.IdentityType; parameters[17].Value = model.SendUnit; parameters[18].Value = model.TrainingBaseProvinceCode; parameters[19].Value = model.TrainingBaseProvinceName; parameters[20].Value = model.TrainingBaseCode; parameters[21].Value = model.TrainingBaseName; parameters[22].Value = model.CollaborativeUnit; parameters[23].Value = model.ProfessionalBaseCode; parameters[24].Value = model.ProfessionalBaseName; parameters[25].Value = model.TrainingTime; parameters[26].Value = model.PlanTrainingTime; parameters[27].Value = model.Tag1; parameters[28].Value = model.Tag2; parameters[29].Value = model.Tag3; parameters[30].Value = model.Id; int rows = db.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
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 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; real_name.Text = loginModel.real_name; real_name.ReadOnly = true; if (string.IsNullOrEmpty(id)) { register_date.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); } na = loginModel.name; name.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(); training_base_name.Text = studentsPersonalInformationModel.TrainingBaseName.ToString(); training_base_name.ReadOnly = true; ProfessionalBaseCode.Value = studentsPersonalInformationModel.ProfessionalBaseCode.ToString(); professional_base_name.Text = studentsPersonalInformationModel.ProfessionalBaseName.ToString(); professional_base_name.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")); } } }
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; students_real_name.Text = loginModel.real_name; students_real_name.ReadOnly = true; if (string.IsNullOrEmpty(id)) { register_date.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); } na = loginModel.name; students_name.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(); training_base_name.Text = studentsPersonalInformationModel.TrainingBaseName.ToString(); training_base_name.ReadOnly = true; ProfessionalBaseCode.Value = studentsPersonalInformationModel.ProfessionalBaseCode.ToString(); professional_base_name.Text = studentsPersonalInformationModel.ProfessionalBaseName.ToString(); professional_base_name.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值来做修改操作,则在界面上把值都呈现出来 bedManagementMode = new BedManagementModel(); bedManagementBLL = new BedManagementBLL(); bedManagementMode = bedManagementBLL.GetModelById(id); students_real_name.Text = bedManagementMode.students_real_name.ToString(); training_base_name.Text = bedManagementMode.training_base_name.ToString(); professional_base_name.Text = bedManagementMode.professional_base_name.ToString(); //RotaryDept.SelectedItem.Text = bedManagementMode.dept_name.ToString(); RotaryDept.SelectedValue = bedManagementMode.dept_code.ToString(); //RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0")); dt = new LoginBLL().GetTeachersDtByDeptCode(bedManagementMode.training_base_code, bedManagementMode.professional_base_code, bedManagementMode.dept_code, "teachers"); Teacher.DataSource = dt; Teacher.DataTextField = "real_name"; Teacher.DataValueField = "name"; Teacher.DataBind(); Teacher.Items.Insert(0, new ListItem("==请选择==", "0")); Teacher.SelectedValue = bedManagementMode.TeacherId; //Teacher.SelectedItem.Text = bedManagementMode.TeacherName.ToString(); //Teacher.SelectedItem.Value = bedManagementMode.TeacherId.ToString(); patient_name.Text = bedManagementMode.patient_name.ToString(); patient_id.Text = bedManagementMode.patient_id.ToString(); bed_id.Text = bedManagementMode.bed_id.ToString(); bed_card.Text = bedManagementMode.bed_card.ToString(); bed_price.Text = bedManagementMode.bed_price.ToString(); bed_status.Text = bedManagementMode.bed_status.ToString(); room_id.Text = bedManagementMode.room_id.ToString(); building_id.Text = bedManagementMode.building_id.ToString(); comment.Text = bedManagementMode.comment.ToString(); writor.Text = bedManagementMode.writor.ToString(); register_date.Text = bedManagementMode.register_date.ToString(); } } }
public bool Update(StudentsPersonalInformation2Model model) { return(dal.Update(model)); }
public bool Add(StudentsPersonalInformation2Model model) { return(dal.Add(model)); }