public GradeSubjectSetting DeepClone()
        {
            GradeSubjectSetting gss = new GradeSubjectSetting(_classSubjectSettingCollections.Count);

            foreach (KeyValuePair <int, ClassSubjectSettingCollection> kvp in _classSubjectSettingCollections)
            {
                gss._classSubjectSettingCollections.Add(kvp.Key, kvp.Value);
            }
            return(gss);
        }
Example #2
0
        /// <summary>
        /// 载入全年级课程设置
        /// </summary>
        public static void LoadGradeSubjectSetting()
        {
            DataTable dt;

            _gradeSubjectSetting = new GradeSubjectSetting(ClassCount);
            for (int i = 0; i <= ClassCount; i++)
            {
                dt = StaticSQLiteHelper.GetClassSubjectSetting(i);
                ClassSubjectSettingCollection cssc = new ClassSubjectSettingCollection(dt.Rows.Count);
                foreach (DataRow row in dt.Rows)
                {
                    cssc.Add(row[0].ToString(), new ClassSubjectSetting(row[0].ToString(), Convert.ToInt32(row[1]), Convert.ToInt32(row[2]), (bool)row[3], row.IsNull(3)?0:Convert.ToInt32(row[3])));
                }
                _gradeSubjectSetting.Add(i, cssc);
            }
        }