/// <summary>セルの編集可能 /// </summary> /// <param name="sender">イベントの発生したオブジェクト</param> /// <param name="e">発生したイベント</param> private void BodyTable_CellEnter (object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 1) { if (Editable && e.RowIndex >= 0) { BodyTable.BeginEdit(true); } } }
/// <summary>ダブルクリック時の処理 /// </summary> /// <param name="sender">イベントの発生したオブジェクト</param> /// <param name="e">発生したイベント</param> private void BodyTable_CellMouseDoubleClick (object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0) { CMember member = this.Members[e.RowIndex]; switch (e.ColumnIndex) { case 0: // メンバーの修正 TimeTableManager.UI.FMemberDialog dialogM = new TimeTableManager.UI.FMemberDialog(); dialogM.Member = member; if (dialogM.ShowDialog(this.MainForm) == DialogResult.OK) { Refresh(); } break; case 1: // シフトの修正 PatternWrapper wrapper = Member2PatternWrapper[member]; CPattern pattern = wrapper.Pattern; if (pattern != null && !pattern.BuiltIn) { TimeTableManager.UI.FPatternDialog dialogP = new TimeTableManager.UI.FPatternDialog(); dialogP.Pattern = pattern; if (dialogP.ShowDialog(this.MainForm) == DialogResult.OK) { Refresh(); } } break; case 2: // コメントの追加・修正 if (Dates.Count == 1 && Editable) { BodyTable.CurrentCell = BodyTable[e.ColumnIndex, e.RowIndex]; BodyTable.BeginEdit(true); } break; } } else { } }
/// <summary>コメントの追加・修正 /// </summary> /// <param name="sender">イベントの発生したオブジェクト</param> /// <param name="e">発生したイベント</param> private void TsmiComment_Click (object sender, EventArgs e) { if (Dates.Count == 1 && Editable) { //Member member = this.Members[this.CurrentRowIndex]; //DateTime date = dates[0]; //Schedule schedule = this.TimeTable[date][member]; //string comment = schedule.Notes; //comment = InputBox.Show(MainForm, comment); //if (!comment.Equals(schedule.Notes)) { // schedule.Notes = comment; // BodyTable.Refresh(); //} BodyTable.CurrentCell = BodyTable[2, CurrentRowIndex]; BodyTable.BeginEdit(true); } }