Example #1
0
        public bool Update(Model_StatsStuHW_TQ_Score model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update StatsStuHW_TQ_Score set ");
            builder.Append("HomeWork_Id=@HomeWork_Id,");
            builder.Append("HomeWorkCreateTime=@HomeWorkCreateTime,");
            builder.Append("Student_HomeWork_Id=@Student_HomeWork_Id,");
            builder.Append("Student_Id=@Student_Id,");
            builder.Append("TestQuestions_Id=@TestQuestions_Id,");
            builder.Append("TestQuestions_Score_Id=@TestQuestions_Score_Id,");
            builder.Append("topicNumber=@topicNumber,");
            builder.Append("TestQuestions_Num=@TestQuestions_Num,");
            builder.Append("testIndex=@testIndex,");
            builder.Append("TestType=@TestType,");
            builder.Append("ComplexityText=@ComplexityText,");
            builder.Append("S_KnowledgePoint_Id=@S_KnowledgePoint_Id,");
            builder.Append("KPNameBasic=@KPNameBasic,");
            builder.Append("S_TestingPoint_Id=@S_TestingPoint_Id,");
            builder.Append("TPNameBasic=@TPNameBasic,");
            builder.Append("KPImportant=@KPImportant,");
            builder.Append("TQScore=@TQScore,");
            builder.Append("Score=@Score,");
            builder.Append("TQScoreAvg=@TQScoreAvg,");
            builder.Append("TQScoreAvgRate=@TQScoreAvgRate,");
            builder.Append("CreateTime=@CreateTime");
            builder.Append(" where StatsStuHW_TQ_Score_Id=@StatsStuHW_TQ_Score_Id ");
            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@HomeWorkCreateTime", SqlDbType.DateTime), new SqlParameter("@Student_HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@Student_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Score_Id", SqlDbType.Char, 0x24), new SqlParameter("@topicNumber", SqlDbType.NVarChar, 50), new SqlParameter("@TestQuestions_Num", SqlDbType.Int, 4), new SqlParameter("@testIndex", SqlDbType.Int, 4), new SqlParameter("@TestType", SqlDbType.VarChar, 500), new SqlParameter("@ComplexityText", SqlDbType.VarChar, 500), new SqlParameter("@S_KnowledgePoint_Id", SqlDbType.VarChar, 500), new SqlParameter("@KPNameBasic", SqlDbType.VarChar, 0x7d0), new SqlParameter("@S_TestingPoint_Id", SqlDbType.VarChar, 500), new SqlParameter("@TPNameBasic", SqlDbType.VarChar, 0x7d0), new SqlParameter("@KPImportant", SqlDbType.VarChar, 500),
                new SqlParameter("@TQScore", SqlDbType.Decimal, 9), new SqlParameter("@Score", SqlDbType.Decimal, 9), new SqlParameter("@TQScoreAvg", SqlDbType.Decimal, 9), new SqlParameter("@TQScoreAvgRate", SqlDbType.Decimal, 9), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@StatsStuHW_TQ_Score_Id", SqlDbType.Char, 0x24)
            };
            cmdParms[0].Value    = model.HomeWork_Id;
            cmdParms[1].Value    = model.HomeWorkCreateTime;
            cmdParms[2].Value    = model.Student_HomeWork_Id;
            cmdParms[3].Value    = model.Student_Id;
            cmdParms[4].Value    = model.TestQuestions_Id;
            cmdParms[5].Value    = model.TestQuestions_Score_Id;
            cmdParms[6].Value    = model.topicNumber;
            cmdParms[7].Value    = model.TestQuestions_Num;
            cmdParms[8].Value    = model.testIndex;
            cmdParms[9].Value    = model.TestType;
            cmdParms[10].Value   = model.ComplexityText;
            cmdParms[11].Value   = model.S_KnowledgePoint_Id;
            cmdParms[12].Value   = model.KPNameBasic;
            cmdParms[13].Value   = model.S_TestingPoint_Id;
            cmdParms[14].Value   = model.TPNameBasic;
            cmdParms[15].Value   = model.KPImportant;
            cmdParms[0x10].Value = model.TQScore;
            cmdParms[0x11].Value = model.Score;
            cmdParms[0x12].Value = model.TQScoreAvg;
            cmdParms[0x13].Value = model.TQScoreAvgRate;
            cmdParms[20].Value   = model.CreateTime;
            cmdParms[0x15].Value = model.StatsStuHW_TQ_Score_Id;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Example #2
0
        public List <Model_StatsStuHW_TQ_Score> DataTableToList(DataTable dt)
        {
            List <Model_StatsStuHW_TQ_Score> list = new List <Model_StatsStuHW_TQ_Score>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    Model_StatsStuHW_TQ_Score item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Example #3
0
        public bool Add(Model_StatsStuHW_TQ_Score model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into StatsStuHW_TQ_Score(");
            builder.Append("StatsStuHW_TQ_Score_Id,HomeWork_Id,HomeWorkCreateTime,Student_HomeWork_Id,Student_Id,TestQuestions_Id,TestQuestions_Score_Id,topicNumber,TestQuestions_Num,testIndex,TestType,ComplexityText,S_KnowledgePoint_Id,KPNameBasic,S_TestingPoint_Id,TPNameBasic,KPImportant,TQScore,Score,TQScoreAvg,TQScoreAvgRate,CreateTime)");
            builder.Append(" values (");
            builder.Append("@StatsStuHW_TQ_Score_Id,@HomeWork_Id,@HomeWorkCreateTime,@Student_HomeWork_Id,@Student_Id,@TestQuestions_Id,@TestQuestions_Score_Id,@topicNumber,@TestQuestions_Num,@testIndex,@TestType,@ComplexityText,@S_KnowledgePoint_Id,@KPNameBasic,@S_TestingPoint_Id,@TPNameBasic,@KPImportant,@TQScore,@Score,@TQScoreAvg,@TQScoreAvgRate,@CreateTime)");
            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@StatsStuHW_TQ_Score_Id", SqlDbType.Char, 0x24), new SqlParameter("@HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@HomeWorkCreateTime", SqlDbType.DateTime), new SqlParameter("@Student_HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@Student_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Score_Id", SqlDbType.Char, 0x24), new SqlParameter("@topicNumber", SqlDbType.NVarChar, 50), new SqlParameter("@TestQuestions_Num", SqlDbType.Int, 4), new SqlParameter("@testIndex", SqlDbType.Int, 4), new SqlParameter("@TestType", SqlDbType.VarChar, 500), new SqlParameter("@ComplexityText", SqlDbType.VarChar, 500), new SqlParameter("@S_KnowledgePoint_Id", SqlDbType.VarChar, 500), new SqlParameter("@KPNameBasic", SqlDbType.VarChar, 0x7d0), new SqlParameter("@S_TestingPoint_Id", SqlDbType.VarChar, 500), new SqlParameter("@TPNameBasic", SqlDbType.VarChar, 0x7d0),
                new SqlParameter("@KPImportant", SqlDbType.VarChar, 500), new SqlParameter("@TQScore", SqlDbType.Decimal, 9), new SqlParameter("@Score", SqlDbType.Decimal, 9), new SqlParameter("@TQScoreAvg", SqlDbType.Decimal, 9), new SqlParameter("@TQScoreAvgRate", SqlDbType.Decimal, 9), new SqlParameter("@CreateTime", SqlDbType.DateTime)
            };
            cmdParms[0].Value    = model.StatsStuHW_TQ_Score_Id;
            cmdParms[1].Value    = model.HomeWork_Id;
            cmdParms[2].Value    = model.HomeWorkCreateTime;
            cmdParms[3].Value    = model.Student_HomeWork_Id;
            cmdParms[4].Value    = model.Student_Id;
            cmdParms[5].Value    = model.TestQuestions_Id;
            cmdParms[6].Value    = model.TestQuestions_Score_Id;
            cmdParms[7].Value    = model.topicNumber;
            cmdParms[8].Value    = model.TestQuestions_Num;
            cmdParms[9].Value    = model.testIndex;
            cmdParms[10].Value   = model.TestType;
            cmdParms[11].Value   = model.ComplexityText;
            cmdParms[12].Value   = model.S_KnowledgePoint_Id;
            cmdParms[13].Value   = model.KPNameBasic;
            cmdParms[14].Value   = model.S_TestingPoint_Id;
            cmdParms[15].Value   = model.TPNameBasic;
            cmdParms[0x10].Value = model.KPImportant;
            cmdParms[0x11].Value = model.TQScore;
            cmdParms[0x12].Value = model.Score;
            cmdParms[0x13].Value = model.TQScoreAvg;
            cmdParms[20].Value   = model.TQScoreAvgRate;
            cmdParms[0x15].Value = model.CreateTime;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Example #4
0
 public bool Add(Model_StatsStuHW_TQ_Score model)
 {
     return(this.dal.Add(model));
 }
Example #5
0
 public bool Update(Model_StatsStuHW_TQ_Score model)
 {
     return(this.dal.Update(model));
 }
Example #6
0
        public Model_StatsStuHW_TQ_Score DataRowToModel(DataRow row)
        {
            Model_StatsStuHW_TQ_Score score = new Model_StatsStuHW_TQ_Score();

            if (row != null)
            {
                if (row["StatsStuHW_TQ_Score_Id"] != null)
                {
                    score.StatsStuHW_TQ_Score_Id = row["StatsStuHW_TQ_Score_Id"].ToString();
                }
                if (row["HomeWork_Id"] != null)
                {
                    score.HomeWork_Id = row["HomeWork_Id"].ToString();
                }
                if ((row["HomeWorkCreateTime"] != null) && (row["HomeWorkCreateTime"].ToString() != ""))
                {
                    score.HomeWorkCreateTime = new DateTime?(DateTime.Parse(row["HomeWorkCreateTime"].ToString()));
                }
                if (row["Student_HomeWork_Id"] != null)
                {
                    score.Student_HomeWork_Id = row["Student_HomeWork_Id"].ToString();
                }
                if (row["Student_Id"] != null)
                {
                    score.Student_Id = row["Student_Id"].ToString();
                }
                if (row["TestQuestions_Id"] != null)
                {
                    score.TestQuestions_Id = row["TestQuestions_Id"].ToString();
                }
                if (row["TestQuestions_Score_Id"] != null)
                {
                    score.TestQuestions_Score_Id = row["TestQuestions_Score_Id"].ToString();
                }
                if (row["topicNumber"] != null)
                {
                    score.topicNumber = row["topicNumber"].ToString();
                }
                if ((row["TestQuestions_Num"] != null) && (row["TestQuestions_Num"].ToString() != ""))
                {
                    score.TestQuestions_Num = new int?(int.Parse(row["TestQuestions_Num"].ToString()));
                }
                if ((row["testIndex"] != null) && (row["testIndex"].ToString() != ""))
                {
                    score.testIndex = new int?(int.Parse(row["testIndex"].ToString()));
                }
                if (row["TestType"] != null)
                {
                    score.TestType = row["TestType"].ToString();
                }
                if (row["ComplexityText"] != null)
                {
                    score.ComplexityText = row["ComplexityText"].ToString();
                }
                if (row["S_KnowledgePoint_Id"] != null)
                {
                    score.S_KnowledgePoint_Id = row["S_KnowledgePoint_Id"].ToString();
                }
                if (row["KPNameBasic"] != null)
                {
                    score.KPNameBasic = row["KPNameBasic"].ToString();
                }
                if (row["S_TestingPoint_Id"] != null)
                {
                    score.S_TestingPoint_Id = row["S_TestingPoint_Id"].ToString();
                }
                if (row["TPNameBasic"] != null)
                {
                    score.TPNameBasic = row["TPNameBasic"].ToString();
                }
                if (row["KPImportant"] != null)
                {
                    score.KPImportant = row["KPImportant"].ToString();
                }
                if ((row["TQScore"] != null) && (row["TQScore"].ToString() != ""))
                {
                    score.TQScore = new decimal?(decimal.Parse(row["TQScore"].ToString()));
                }
                if ((row["Score"] != null) && (row["Score"].ToString() != ""))
                {
                    score.Score = new decimal?(decimal.Parse(row["Score"].ToString()));
                }
                if ((row["TQScoreAvg"] != null) && (row["TQScoreAvg"].ToString() != ""))
                {
                    score.TQScoreAvg = new decimal?(decimal.Parse(row["TQScoreAvg"].ToString()));
                }
                if ((row["TQScoreAvgRate"] != null) && (row["TQScoreAvgRate"].ToString() != ""))
                {
                    score.TQScoreAvgRate = new decimal?(decimal.Parse(row["TQScoreAvgRate"].ToString()));
                }
                if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != ""))
                {
                    score.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString()));
                }
            }
            return(score);
        }