public bool Insert(Model.OutDeptExamModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into GP_OutDept_Exam("); strSql.Append("id,students_name,students_real_name,sex,training_base_code,training_base_name,high_education,high_education_time,professional_base_code,professional_base_name,rotary_dept_code,rotary_dept_name,rotary_begin_time,rotary_end_time,instructor,instructor_tag,kqqk,gztd,ydyf,llsp,zdzx,blsx,clbrnl,sjcznl,czjn,zdsp,djnl,total_score,instructor_date,is_pass,dept_manager,dept_manager_date)"); strSql.Append(" values ("); strSql.Append("@id,@students_name,@students_real_name,@sex,@training_base_code,@training_base_name,@high_education,@high_education_time,@professional_base_code,@professional_base_name,@rotary_dept_code,@rotary_dept_name,@rotary_begin_time,@rotary_end_time,@instructor,@instructor_tag,@kqqk,@gztd,@ydyf,@llsp,@zdzx,@blsx,@clbrnl,@sjcznl,@czjn,@zdsp,@djnl,@total_score,@instructor_date,@is_pass,@dept_manager,@dept_manager_date)"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.NVarChar, 50), new SqlParameter("@students_name", SqlDbType.NVarChar, 50), new SqlParameter("@students_real_name", SqlDbType.NVarChar, 50), new SqlParameter("@sex", SqlDbType.NVarChar, 50), new SqlParameter("@training_base_code", SqlDbType.NVarChar, 50), new SqlParameter("@training_base_name", SqlDbType.NVarChar, 50), new SqlParameter("@high_education", SqlDbType.NVarChar, 50), new SqlParameter("@high_education_time", SqlDbType.NVarChar, 50), new SqlParameter("@professional_base_code", SqlDbType.NVarChar, 50), new SqlParameter("@professional_base_name", SqlDbType.NVarChar, 50), new SqlParameter("@rotary_dept_code", SqlDbType.NVarChar, 50), new SqlParameter("@rotary_dept_name", SqlDbType.NVarChar, 50), new SqlParameter("@rotary_begin_time", SqlDbType.NVarChar, 50), new SqlParameter("@rotary_end_time", SqlDbType.NVarChar, 50), new SqlParameter("@instructor", SqlDbType.NVarChar, 50), new SqlParameter("@instructor_tag", SqlDbType.NVarChar, 50), new SqlParameter("@kqqk", SqlDbType.NVarChar, 10), new SqlParameter("@gztd", SqlDbType.NVarChar, 10), new SqlParameter("@ydyf", SqlDbType.NVarChar, 10), new SqlParameter("@llsp", SqlDbType.NVarChar, 10), new SqlParameter("@zdzx", SqlDbType.NVarChar, 10), new SqlParameter("@blsx", SqlDbType.NVarChar, 10), new SqlParameter("@clbrnl", SqlDbType.NVarChar, 10), new SqlParameter("@sjcznl", SqlDbType.NVarChar, 10), new SqlParameter("@czjn", SqlDbType.NVarChar, 10), new SqlParameter("@zdsp", SqlDbType.NVarChar, 10), new SqlParameter("@djnl", SqlDbType.NVarChar, 10), new SqlParameter("@total_score", SqlDbType.NVarChar, 10), new SqlParameter("@instructor_date", SqlDbType.NVarChar, 50), new SqlParameter("@is_pass", SqlDbType.NVarChar, 10), new SqlParameter("@dept_manager", SqlDbType.NVarChar, 50), new SqlParameter("@dept_manager_date", SqlDbType.NVarChar, 10) }; parameters[0].Value = model.id; parameters[1].Value = model.students_name; parameters[2].Value = model.students_real_name; parameters[3].Value = model.sex; parameters[4].Value = model.training_base_code; parameters[5].Value = model.training_base_name; parameters[6].Value = model.high_education; parameters[7].Value = model.high_education_time; parameters[8].Value = model.professional_base_code; parameters[9].Value = model.professional_base_name; parameters[10].Value = model.rotary_dept_code; parameters[11].Value = model.rotary_dept_name; parameters[12].Value = model.rotary_begin_time; parameters[13].Value = model.rotary_end_time; parameters[14].Value = model.instructor; parameters[15].Value = model.instructor_tag; parameters[16].Value = model.kqqk; parameters[17].Value = model.gztd; parameters[18].Value = model.ydyf; parameters[19].Value = model.llsp; parameters[20].Value = model.zdzx; parameters[21].Value = model.blsx; parameters[22].Value = model.clbrnl; parameters[23].Value = model.sjcznl; parameters[24].Value = model.czjn; parameters[25].Value = model.zdsp; parameters[26].Value = model.djnl; parameters[27].Value = model.total_score; parameters[28].Value = model.instructor_date; parameters[29].Value = model.is_pass; parameters[30].Value = model.dept_manager; parameters[31].Value = model.dept_manager_date; int rows = db.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public bool Insert(Model.OutDeptExamModel model) { return(outDeptExamDAL.Insert(model)); }