/// <summary>
            /// 建構子
            /// </summary>
            /// <param name="record"></param>
            public JHSCETakeRecord(JHSchool.Data.JHSCETakeRecord record)
            {
                _record = record;

                #region 嘗試取得 Effort
                XmlNode effort = record.ToXML().SelectSingleNode("Extension/Extension/Effort");
                if (effort != null)
                {
                    Effort = ParseIntAllowNull(effort.InnerText);
                }
                #endregion
            }
            /// <summary>
            /// 建構子
            /// </summary>
            /// <param name="record"></param>
            public JHSCETakeRecord(JHSchool.Data.JHSCETakeRecord record)
            {
                _record = record;

                #region 嘗試取得 AssignmentScore
                XmlNode assignment = record.ToXML().SelectSingleNode("Extension/Extension/AssignmentScore");
                if (assignment != null)
                {
                    AssignmentScore = ParseDecimalAllowNull(assignment.InnerText);
                }
                #endregion
            }
        /// <summary>
        /// 從DataGridView上取得SCETakeRecordEditors
        /// </summary>
        /// <returns></returns>
        //private List<SCETakeRecordEditor> MakeSCETakeRecordEditors()
        //{
        //    if (cboExamList.SelectedItem == null) return new List<SCETakeRecordEditor>();

        //    List<SCETakeRecordEditor> list = new List<SCETakeRecordEditor>();
        //    ExamComboBoxItem item = cboExamList.SelectedItem as ExamComboBoxItem;
        //    ExamRecord exam = item.AEIncludeRecord.Exam;

        //    foreach (DataGridViewRow row in dgv.Rows)
        //    {
        //        SCAttendTag tag = row.Tag as SCAttendTag;
        //        if (tag.SCETake != null)
        //        {
        //            #region 修改or刪除
        //            bool is_remove = true;

        //            SCETakeRecordEditor editor = tag.SCETake.GetEditor();

        //            if (chInputScore.Visible == true)
        //            {
        //                string value = "" + row.Cells[chInputScore.Index].Value;
        //                is_remove &= string.IsNullOrEmpty(value);
        //                if (!string.IsNullOrEmpty(value))
        //                    editor.Score = decimal.Parse(value);
        //            }
        //            if (chInputEffort.Visible == true)
        //            {
        //                string value = "" + row.Cells[chInputEffort.Index].Value;
        //                is_remove &= string.IsNullOrEmpty(value);
        //                if (!string.IsNullOrEmpty(value))
        //                    editor.Effort = int.Parse(value);
        //            }
        //            if (chInputText.Visible == true)
        //            {
        //                string value = "" + row.Cells[chInputText.Index].Value;
        //                is_remove &= string.IsNullOrEmpty(value);
        //                editor.Text = value;
        //            }

        //            editor.Remove = is_remove;
        //            list.Add(editor);
        //            #endregion
        //        }
        //        else
        //        {
        //            #region 新增
        //            bool is_add = false;

        //            SCETakeRecordEditor editor = new SCETakeRecordEditor(tag.SCAttend, exam);

        //            if (chInputScore.Visible == true)
        //            {
        //                string value = "" + row.Cells[chInputScore.Index].Value;
        //                if (!string.IsNullOrEmpty(value))
        //                {
        //                    editor.Score = decimal.Parse(value);
        //                    is_add = true;
        //                }
        //            }
        //            if (chInputEffort.Visible == true)
        //            {
        //                string value = "" + row.Cells[chInputEffort.Index].Value;
        //                if (!string.IsNullOrEmpty(value))
        //                {
        //                    editor.Effort = int.Parse(value);
        //                    is_add = true;
        //                }
        //            }
        //            if (chInputText.Visible == true)
        //            {
        //                string value = "" + row.Cells[chInputText.Index].Value;
        //                if (!string.IsNullOrEmpty(value))
        //                {
        //                    editor.Text = value;
        //                    is_add = true;
        //                }
        //            }

        //            if (is_add) list.Add(editor);
        //            #endregion
        //        }
        //    }

        //    return list;
        //}

        /// <summary>
        /// 從DataGridView上取得 HC.JHSCETakeRecord
        /// </summary>
        /// <returns></returns>
        private RecordIUDLists GetRecords()
        {
            if (cboExamList.SelectedItem == null)
            {
                return(new RecordIUDLists());
            }

            RecordIUDLists lists = new RecordIUDLists();

            ExamComboBoxItem item = cboExamList.SelectedItem as ExamComboBoxItem;
            JHExamRecord     exam = item.AEIncludeRecord.Exam;

            foreach (DataGridViewRow row in dgv.Rows)
            {
                SCAttendTag tag = row.Tag as SCAttendTag;
                if (tag.SCETake != null)
                {
                    HC.JHSCETakeRecord record = tag.SCETake;

                    #region 修改or刪除
                    bool is_remove = true;

                    if (chInputScore.Visible == true)
                    {
                        string value = ("" + row.Cells[chInputScore.Index].Value).Trim();
                        if (PluginMain.ScoreTextMap.ContainsKey(value))
                        {
                            value = PluginMain.ScoreTextMap[value].UseValue.ToString();
                        }
                        is_remove &= string.IsNullOrEmpty(value);
                        if (!string.IsNullOrEmpty(value))
                        {
                            record.Score = decimal.Parse(value);
                        }
                        // 小郭, 2013/12/30
                        else
                        {
                            record.Score = null;
                        }
                    }
                    if (chInputAssignmentScore.Visible == true)
                    {
                        string value = ("" + row.Cells[chInputAssignmentScore.Index].Value).Trim();
                        if (PluginMain.ScoreTextMap.ContainsKey(value))
                        {
                            value = PluginMain.ScoreTextMap[value].UseValue.ToString();
                        }
                        is_remove &= string.IsNullOrEmpty(value);
                        if (!string.IsNullOrEmpty(value))
                        {
                            record.AssignmentScore = decimal.Parse(value);
                        }
                        // 小郭, 2013/12/30
                        else
                        {
                            record.AssignmentScore = null;
                        }
                    }
                    if (chInputText.Visible == true)
                    {
                        string value = "" + row.Cells[chInputText.Index].Value;
                        is_remove  &= string.IsNullOrEmpty(value);
                        record.Text = value;
                    }

                    if (is_remove)
                    {
                        lists.DeleteList.Add(record);
                    }
                    else
                    {
                        lists.UpdateList.Add(record);
                    }
                    #endregion
                }
                else
                {
                    #region 新增
                    bool is_add = false;

                    JHSchool.Data.JHSCETakeRecord jh     = new JHSchool.Data.JHSCETakeRecord();
                    HC.JHSCETakeRecord            record = new HC.JHSCETakeRecord(jh);

                    record.RefCourseID   = tag.SCAttend.Course.ID;
                    record.RefExamID     = exam.ID;
                    record.RefSCAttendID = tag.SCAttend.ID;
                    record.RefStudentID  = tag.SCAttend.Student.ID;

                    record.Score           = null;
                    record.AssignmentScore = null;
                    record.Text            = string.Empty;

                    if (chInputScore.Visible == true)
                    {
                        string value = ("" + row.Cells[chInputScore.Index].Value).Trim();
                        if (PluginMain.ScoreTextMap.ContainsKey(value))
                        {
                            value = PluginMain.ScoreTextMap[value].UseValue.ToString();
                        }
                        if (!string.IsNullOrEmpty(value))
                        {
                            record.Score = decimal.Parse(value);
                            is_add       = true;
                        }
                    }
                    if (chInputAssignmentScore.Visible == true)
                    {
                        string value = ("" + row.Cells[chInputAssignmentScore.Index].Value).Trim();
                        if (PluginMain.ScoreTextMap.ContainsKey(value))
                        {
                            value = PluginMain.ScoreTextMap[value].UseValue.ToString();
                        }
                        if (!string.IsNullOrEmpty(value))
                        {
                            record.AssignmentScore = decimal.Parse(value);
                            is_add = true;
                        }
                    }
                    if (chInputText.Visible == true)
                    {
                        string value = "" + row.Cells[chInputText.Index].Value;
                        if (!string.IsNullOrEmpty(value))
                        {
                            record.Text = value;
                            is_add      = true;
                        }
                    }

                    if (is_add)
                    {
                        lists.InsertList.Add(record);
                    }
                    #endregion
                }
            }

            return(lists);
        }