示例#1
0
        private void changeSpecalAttribute(Model.Course course, StuList stuList, DataGridViewCellEventArgs e)
        {
            Student            stu    = stuList[editingStudentId];
            DataGridViewColumn column = mainGrid.Columns[e.ColumnIndex];
            string             UUID   = column.Name;
            SubAttandance      subAtt = course.getSubAttandance(UUID);
            string             value  = (string)mainGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;

            if (subAtt != null)
            {
                Record recordToChangeTo = course.getRecord(value);
                changeAttandance(stu, subAtt, recordToChangeTo);
                mainGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = recordToChangeTo.recordColor;
            }
            else
            {
                subExtra subExt = course.getExtra(UUID);
                changeExtra(stu, subExt, value);
                mainGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = subExt[value].typeColor;
            }
        }
示例#2
0
        private void modifyExtraTitle(string itemText, object userData)
        {
            DataGridViewColumn column   = userData as DataGridViewColumn;
            InputResult        result   = HKTextInputForm.showInputform("修改标题", column.HeaderText);
            subExtra           subExt   = null;
            string             oldTitle = null;

            if (result.confirm)
            {
                string extraUUID = column.Name;
                subExt      = courseRef.getExtra(extraUUID);
                oldTitle    = subExt.name;
                subExt.name = result.input;
                GlobalStation.shareInstance.librarySave(delegate() {
                    stopCellValueChanged();
                    column.HeaderText = result.input;
                    startCellValueChanged();
                }, delegate() {
                    subExt.name = oldTitle;
                });
            }
        }