public bool Add(Model_StatsStuHW_TQ_KP model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into StatsStuHW_TQ_KP("); builder.Append("StatsStuHW_TQ_KP_Id,HomeWork_Id,Student_Id,Subject,Resource_Version,Book_Type,Parent_Id,S_KnowledgePoint_Id,KPNameBasic,KPImportant,GKScore,TestQuestions_Id,TestQuestions_Score_Id,ComplexityText,TQScore,Score,Student_Answer_Status,CreateTime)"); builder.Append(" values ("); builder.Append("@StatsStuHW_TQ_KP_Id,@HomeWork_Id,@Student_Id,@Subject,@Resource_Version,@Book_Type,@Parent_Id,@S_KnowledgePoint_Id,@KPNameBasic,@KPImportant,@GKScore,@TestQuestions_Id,@TestQuestions_Score_Id,@ComplexityText,@TQScore,@Score,@Student_Answer_Status,@CreateTime)"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@StatsStuHW_TQ_KP_Id", SqlDbType.Char, 0x24), new SqlParameter("@HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@Student_Id", SqlDbType.Char, 0x24), new SqlParameter("@Subject", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Version", SqlDbType.Char, 0x24), new SqlParameter("@Book_Type", SqlDbType.Char, 0x24), new SqlParameter("@Parent_Id", SqlDbType.Char, 0x24), new SqlParameter("@S_KnowledgePoint_Id", SqlDbType.Char, 0x24), new SqlParameter("@KPNameBasic", SqlDbType.VarChar, 200), new SqlParameter("@KPImportant", SqlDbType.Int, 4), new SqlParameter("@GKScore", SqlDbType.Decimal, 9), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Score_Id", SqlDbType.Char, 0x24), new SqlParameter("@ComplexityText", SqlDbType.VarChar, 500), new SqlParameter("@TQScore", SqlDbType.Decimal, 9), new SqlParameter("@Score", SqlDbType.Decimal, 9), new SqlParameter("@Student_Answer_Status", SqlDbType.VarChar, 20), new SqlParameter("@CreateTime", SqlDbType.DateTime) }; cmdParms[0].Value = model.StatsStuHW_TQ_KP_Id; cmdParms[1].Value = model.HomeWork_Id; cmdParms[2].Value = model.Student_Id; cmdParms[3].Value = model.Subject; cmdParms[4].Value = model.Resource_Version; cmdParms[5].Value = model.Book_Type; cmdParms[6].Value = model.Parent_Id; cmdParms[7].Value = model.S_KnowledgePoint_Id; cmdParms[8].Value = model.KPNameBasic; cmdParms[9].Value = model.KPImportant; cmdParms[10].Value = model.GKScore; cmdParms[11].Value = model.TestQuestions_Id; cmdParms[12].Value = model.TestQuestions_Score_Id; cmdParms[13].Value = model.ComplexityText; cmdParms[14].Value = model.TQScore; cmdParms[15].Value = model.Score; cmdParms[0x10].Value = model.Student_Answer_Status; cmdParms[0x11].Value = model.CreateTime; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public bool Update(Model_StatsStuHW_TQ_KP model) { StringBuilder builder = new StringBuilder(); builder.Append("update StatsStuHW_TQ_KP set "); builder.Append("HomeWork_Id=@HomeWork_Id,"); builder.Append("Student_Id=@Student_Id,"); builder.Append("Subject=@Subject,"); builder.Append("Resource_Version=@Resource_Version,"); builder.Append("Book_Type=@Book_Type,"); builder.Append("Parent_Id=@Parent_Id,"); builder.Append("S_KnowledgePoint_Id=@S_KnowledgePoint_Id,"); builder.Append("KPNameBasic=@KPNameBasic,"); builder.Append("KPImportant=@KPImportant,"); builder.Append("GKScore=@GKScore,"); builder.Append("TestQuestions_Id=@TestQuestions_Id,"); builder.Append("TestQuestions_Score_Id=@TestQuestions_Score_Id,"); builder.Append("ComplexityText=@ComplexityText,"); builder.Append("TQScore=@TQScore,"); builder.Append("Score=@Score,"); builder.Append("Student_Answer_Status=@Student_Answer_Status,"); builder.Append("CreateTime=@CreateTime"); builder.Append(" where StatsStuHW_TQ_KP_Id=@StatsStuHW_TQ_KP_Id "); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@Student_Id", SqlDbType.Char, 0x24), new SqlParameter("@Subject", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Version", SqlDbType.Char, 0x24), new SqlParameter("@Book_Type", SqlDbType.Char, 0x24), new SqlParameter("@Parent_Id", SqlDbType.Char, 0x24), new SqlParameter("@S_KnowledgePoint_Id", SqlDbType.Char, 0x24), new SqlParameter("@KPNameBasic", SqlDbType.VarChar, 200), new SqlParameter("@KPImportant", SqlDbType.Int, 4), new SqlParameter("@GKScore", SqlDbType.Decimal, 9), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Score_Id", SqlDbType.Char, 0x24), new SqlParameter("@ComplexityText", SqlDbType.VarChar, 500), new SqlParameter("@TQScore", SqlDbType.Decimal, 9), new SqlParameter("@Score", SqlDbType.Decimal, 9), new SqlParameter("@Student_Answer_Status", SqlDbType.VarChar, 20), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@StatsStuHW_TQ_KP_Id", SqlDbType.Char, 0x24) }; cmdParms[0].Value = model.HomeWork_Id; cmdParms[1].Value = model.Student_Id; cmdParms[2].Value = model.Subject; cmdParms[3].Value = model.Resource_Version; cmdParms[4].Value = model.Book_Type; cmdParms[5].Value = model.Parent_Id; cmdParms[6].Value = model.S_KnowledgePoint_Id; cmdParms[7].Value = model.KPNameBasic; cmdParms[8].Value = model.KPImportant; cmdParms[9].Value = model.GKScore; cmdParms[10].Value = model.TestQuestions_Id; cmdParms[11].Value = model.TestQuestions_Score_Id; cmdParms[12].Value = model.ComplexityText; cmdParms[13].Value = model.TQScore; cmdParms[14].Value = model.Score; cmdParms[15].Value = model.Student_Answer_Status; cmdParms[0x10].Value = model.CreateTime; cmdParms[0x11].Value = model.StatsStuHW_TQ_KP_Id; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public List <Model_StatsStuHW_TQ_KP> DataTableToList(DataTable dt) { List <Model_StatsStuHW_TQ_KP> list = new List <Model_StatsStuHW_TQ_KP>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Model_StatsStuHW_TQ_KP item = this.dal.DataRowToModel(dt.Rows[i]); if (item != null) { list.Add(item); } } } return(list); }
public bool Add(Model_StatsStuHW_TQ_KP model) { return(this.dal.Add(model)); }
public bool Update(Model_StatsStuHW_TQ_KP model) { return(this.dal.Update(model)); }
public Model_StatsStuHW_TQ_KP DataRowToModel(DataRow row) { Model_StatsStuHW_TQ_KP uhw_tq_kp = new Model_StatsStuHW_TQ_KP(); if (row != null) { if (row["StatsStuHW_TQ_KP_Id"] != null) { uhw_tq_kp.StatsStuHW_TQ_KP_Id = row["StatsStuHW_TQ_KP_Id"].ToString(); } if (row["HomeWork_Id"] != null) { uhw_tq_kp.HomeWork_Id = row["HomeWork_Id"].ToString(); } if (row["Student_Id"] != null) { uhw_tq_kp.Student_Id = row["Student_Id"].ToString(); } if (row["Subject"] != null) { uhw_tq_kp.Subject = row["Subject"].ToString(); } if (row["Resource_Version"] != null) { uhw_tq_kp.Resource_Version = row["Resource_Version"].ToString(); } if (row["Book_Type"] != null) { uhw_tq_kp.Book_Type = row["Book_Type"].ToString(); } if (row["Parent_Id"] != null) { uhw_tq_kp.Parent_Id = row["Parent_Id"].ToString(); } if (row["S_KnowledgePoint_Id"] != null) { uhw_tq_kp.S_KnowledgePoint_Id = row["S_KnowledgePoint_Id"].ToString(); } if (row["KPNameBasic"] != null) { uhw_tq_kp.KPNameBasic = row["KPNameBasic"].ToString(); } if ((row["KPImportant"] != null) && (row["KPImportant"].ToString() != "")) { uhw_tq_kp.KPImportant = new int?(int.Parse(row["KPImportant"].ToString())); } if ((row["GKScore"] != null) && (row["GKScore"].ToString() != "")) { uhw_tq_kp.GKScore = new decimal?(decimal.Parse(row["GKScore"].ToString())); } if (row["TestQuestions_Id"] != null) { uhw_tq_kp.TestQuestions_Id = row["TestQuestions_Id"].ToString(); } if (row["TestQuestions_Score_Id"] != null) { uhw_tq_kp.TestQuestions_Score_Id = row["TestQuestions_Score_Id"].ToString(); } if (row["ComplexityText"] != null) { uhw_tq_kp.ComplexityText = row["ComplexityText"].ToString(); } if ((row["TQScore"] != null) && (row["TQScore"].ToString() != "")) { uhw_tq_kp.TQScore = new decimal?(decimal.Parse(row["TQScore"].ToString())); } if ((row["Score"] != null) && (row["Score"].ToString() != "")) { uhw_tq_kp.Score = new decimal?(decimal.Parse(row["Score"].ToString())); } if (row["Student_Answer_Status"] != null) { uhw_tq_kp.Student_Answer_Status = row["Student_Answer_Status"].ToString(); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { uhw_tq_kp.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } } return(uhw_tq_kp); }