Пример #1
0
        public bool Add(Model_StatsGradeClassHW_Hierarchy model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into StatsGradeClassHW_Hierarchy(");
            builder.Append("StatsGradeClassHW_HierarchyID,ResourceToResourceFolder_Id,Resource_Name,SchoolID,SchoolName,Gradeid,GradeName,ClassID,ClassName,SubjectID,SubjectName,TeacherID,TeacherName,Hierarchy,HierarchyCount,HierarchyCountRate,ClassAllCount,CreateTime)");
            builder.Append(" values (");
            builder.Append("@StatsGradeClassHW_HierarchyID,@ResourceToResourceFolder_Id,@Resource_Name,@SchoolID,@SchoolName,@Gradeid,@GradeName,@ClassID,@ClassName,@SubjectID,@SubjectName,@TeacherID,@TeacherName,@Hierarchy,@HierarchyCount,@HierarchyCountRate,@ClassAllCount,@CreateTime)");
            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@StatsGradeClassHW_HierarchyID", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Name", SqlDbType.NVarChar, 250), new SqlParameter("@SchoolID", SqlDbType.VarChar, 10), new SqlParameter("@SchoolName", SqlDbType.NVarChar, 250), new SqlParameter("@Gradeid", SqlDbType.VarChar, 10), new SqlParameter("@GradeName", SqlDbType.NVarChar, 250), new SqlParameter("@ClassID", SqlDbType.VarChar, 10), new SqlParameter("@ClassName", SqlDbType.NVarChar, 250), new SqlParameter("@SubjectID", SqlDbType.Char, 0x24), new SqlParameter("@SubjectName", SqlDbType.NVarChar, 250), new SqlParameter("@TeacherID", SqlDbType.Char, 0x24), new SqlParameter("@TeacherName", SqlDbType.NVarChar, 250), new SqlParameter("@Hierarchy", SqlDbType.Decimal, 5), new SqlParameter("@HierarchyCount", SqlDbType.Decimal, 5), new SqlParameter("@HierarchyCountRate", SqlDbType.Decimal, 5),
                new SqlParameter("@ClassAllCount", SqlDbType.Decimal, 5), new SqlParameter("@CreateTime", SqlDbType.DateTime)
            };
            cmdParms[0].Value    = model.StatsGradeClassHW_HierarchyID;
            cmdParms[1].Value    = model.ResourceToResourceFolder_Id;
            cmdParms[2].Value    = model.Resource_Name;
            cmdParms[3].Value    = model.SchoolID;
            cmdParms[4].Value    = model.SchoolName;
            cmdParms[5].Value    = model.Gradeid;
            cmdParms[6].Value    = model.GradeName;
            cmdParms[7].Value    = model.ClassID;
            cmdParms[8].Value    = model.ClassName;
            cmdParms[9].Value    = model.SubjectID;
            cmdParms[10].Value   = model.SubjectName;
            cmdParms[11].Value   = model.TeacherID;
            cmdParms[12].Value   = model.TeacherName;
            cmdParms[13].Value   = model.Hierarchy;
            cmdParms[14].Value   = model.HierarchyCount;
            cmdParms[15].Value   = model.HierarchyCountRate;
            cmdParms[0x10].Value = model.ClassAllCount;
            cmdParms[0x11].Value = model.CreateTime;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Пример #2
0
        public bool Update(Model_StatsGradeClassHW_Hierarchy model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update StatsGradeClassHW_Hierarchy set ");
            builder.Append("ResourceToResourceFolder_Id=@ResourceToResourceFolder_Id,");
            builder.Append("Resource_Name=@Resource_Name,");
            builder.Append("SchoolID=@SchoolID,");
            builder.Append("SchoolName=@SchoolName,");
            builder.Append("Gradeid=@Gradeid,");
            builder.Append("GradeName=@GradeName,");
            builder.Append("ClassID=@ClassID,");
            builder.Append("ClassName=@ClassName,");
            builder.Append("SubjectID=@SubjectID,");
            builder.Append("SubjectName=@SubjectName,");
            builder.Append("TeacherID=@TeacherID,");
            builder.Append("TeacherName=@TeacherName,");
            builder.Append("Hierarchy=@Hierarchy,");
            builder.Append("HierarchyCount=@HierarchyCount,");
            builder.Append("HierarchyCountRate=@HierarchyCountRate,");
            builder.Append("ClassAllCount=@ClassAllCount,");
            builder.Append("CreateTime=@CreateTime");
            builder.Append(" where StatsGradeClassHW_HierarchyID=@StatsGradeClassHW_HierarchyID ");
            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@Resource_Name", SqlDbType.NVarChar, 250), new SqlParameter("@SchoolID", SqlDbType.VarChar, 10), new SqlParameter("@SchoolName", SqlDbType.NVarChar, 250), new SqlParameter("@Gradeid", SqlDbType.VarChar, 10), new SqlParameter("@GradeName", SqlDbType.NVarChar, 250), new SqlParameter("@ClassID", SqlDbType.VarChar, 10), new SqlParameter("@ClassName", SqlDbType.NVarChar, 250), new SqlParameter("@SubjectID", SqlDbType.Char, 0x24), new SqlParameter("@SubjectName", SqlDbType.NVarChar, 250), new SqlParameter("@TeacherID", SqlDbType.Char, 0x24), new SqlParameter("@TeacherName", SqlDbType.NVarChar, 250), new SqlParameter("@Hierarchy", SqlDbType.Decimal, 5), new SqlParameter("@HierarchyCount", SqlDbType.Decimal, 5), new SqlParameter("@HierarchyCountRate", SqlDbType.Decimal, 5), new SqlParameter("@ClassAllCount", SqlDbType.Decimal, 5),
                new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@StatsGradeClassHW_HierarchyID", SqlDbType.Char, 0x24)
            };
            cmdParms[0].Value    = model.ResourceToResourceFolder_Id;
            cmdParms[1].Value    = model.Resource_Name;
            cmdParms[2].Value    = model.SchoolID;
            cmdParms[3].Value    = model.SchoolName;
            cmdParms[4].Value    = model.Gradeid;
            cmdParms[5].Value    = model.GradeName;
            cmdParms[6].Value    = model.ClassID;
            cmdParms[7].Value    = model.ClassName;
            cmdParms[8].Value    = model.SubjectID;
            cmdParms[9].Value    = model.SubjectName;
            cmdParms[10].Value   = model.TeacherID;
            cmdParms[11].Value   = model.TeacherName;
            cmdParms[12].Value   = model.Hierarchy;
            cmdParms[13].Value   = model.HierarchyCount;
            cmdParms[14].Value   = model.HierarchyCountRate;
            cmdParms[15].Value   = model.ClassAllCount;
            cmdParms[0x10].Value = model.CreateTime;
            cmdParms[0x11].Value = model.StatsGradeClassHW_HierarchyID;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Пример #3
0
        public List <Model_StatsGradeClassHW_Hierarchy> DataTableToList(DataTable dt)
        {
            List <Model_StatsGradeClassHW_Hierarchy> list = new List <Model_StatsGradeClassHW_Hierarchy>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    Model_StatsGradeClassHW_Hierarchy item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Пример #4
0
        public Model_StatsGradeClassHW_Hierarchy DataRowToModel(DataRow row)
        {
            Model_StatsGradeClassHW_Hierarchy hierarchy = new Model_StatsGradeClassHW_Hierarchy();

            if (row != null)
            {
                if (row["StatsGradeClassHW_HierarchyID"] != null)
                {
                    hierarchy.StatsGradeClassHW_HierarchyID = row["StatsGradeClassHW_HierarchyID"].ToString();
                }
                if (row["ResourceToResourceFolder_Id"] != null)
                {
                    hierarchy.ResourceToResourceFolder_Id = row["ResourceToResourceFolder_Id"].ToString();
                }
                if (row["Resource_Name"] != null)
                {
                    hierarchy.Resource_Name = row["Resource_Name"].ToString();
                }
                if (row["SchoolID"] != null)
                {
                    hierarchy.SchoolID = row["SchoolID"].ToString();
                }
                if (row["SchoolName"] != null)
                {
                    hierarchy.SchoolName = row["SchoolName"].ToString();
                }
                if (row["Gradeid"] != null)
                {
                    hierarchy.Gradeid = row["Gradeid"].ToString();
                }
                if (row["GradeName"] != null)
                {
                    hierarchy.GradeName = row["GradeName"].ToString();
                }
                if (row["ClassID"] != null)
                {
                    hierarchy.ClassID = row["ClassID"].ToString();
                }
                if (row["ClassName"] != null)
                {
                    hierarchy.ClassName = row["ClassName"].ToString();
                }
                if (row["SubjectID"] != null)
                {
                    hierarchy.SubjectID = row["SubjectID"].ToString();
                }
                if (row["SubjectName"] != null)
                {
                    hierarchy.SubjectName = row["SubjectName"].ToString();
                }
                if (row["TeacherID"] != null)
                {
                    hierarchy.TeacherID = row["TeacherID"].ToString();
                }
                if (row["TeacherName"] != null)
                {
                    hierarchy.TeacherName = row["TeacherName"].ToString();
                }
                if ((row["Hierarchy"] != null) && (row["Hierarchy"].ToString() != ""))
                {
                    hierarchy.Hierarchy = new decimal?(decimal.Parse(row["Hierarchy"].ToString()));
                }
                if ((row["HierarchyCount"] != null) && (row["HierarchyCount"].ToString() != ""))
                {
                    hierarchy.HierarchyCount = new decimal?(decimal.Parse(row["HierarchyCount"].ToString()));
                }
                if ((row["HierarchyCountRate"] != null) && (row["HierarchyCountRate"].ToString() != ""))
                {
                    hierarchy.HierarchyCountRate = new decimal?(decimal.Parse(row["HierarchyCountRate"].ToString()));
                }
                if ((row["ClassAllCount"] != null) && (row["ClassAllCount"].ToString() != ""))
                {
                    hierarchy.ClassAllCount = new decimal?(decimal.Parse(row["ClassAllCount"].ToString()));
                }
                if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != ""))
                {
                    hierarchy.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString()));
                }
            }
            return(hierarchy);
        }
Пример #5
0
 public bool Add(Model_StatsGradeClassHW_Hierarchy model)
 {
     return(this.dal.Add(model));
 }
Пример #6
0
 public bool Update(Model_StatsGradeClassHW_Hierarchy model)
 {
     return(this.dal.Update(model));
 }