예제 #1
0
        private void daysGridView_CellContentClick(object i_Sender, DataGridViewCellEventArgs i_E)
        {
            int    day = i_E.RowIndex;
            string msg;

            if (day < 0 || i_E.ColumnIndex < 0)
            {
                return;
            }

            switch ((eColumn)i_E.ColumnIndex)
            {
            case eColumn.Comment:
                msg = (string)monthGridView.Rows[day].Cells[(int)eColumn.Comment].Value;
                msg = new GetCommentForm(msg).ShowDialog();
                if (msg != null)
                {
                    m_TimeWatch.AllDays[day].Comment = msg;
                }
                return;

            case eColumn.Arrival:
            case eColumn.Leaving:
                ArrivalOrLeavingPressed(i_E, day);
                return;

            case eColumn.DayType:
                string chosneDayType = (string)monthGridView.Rows[day].Cells[i_E.ColumnIndex].Value;
                msg = new GetDayTypeWindowForm(chosneDayType).ShowDialog();
                if (!string.IsNullOrEmpty(msg))
                {
                    m_TimeWatch.AllDays[day].DayType = DayTypeFactory.Get(msg);
                }
                return;
            }
        }
예제 #2
0
        private void daysGridView_CellContentClick(object i_Sender, DataGridViewCellEventArgs i_E)
        {
            int day = i_E.RowIndex;
            string msg;

            if (day < 0 || i_E.ColumnIndex < 0) return;

            switch ((eColumn) i_E.ColumnIndex)
            {
                case eColumn.Comment:
                    msg = (string) monthGridView.Rows[day].Cells[(int) eColumn.Comment].Value;
                    msg = new GetCommentForm(msg).ShowDialog();
                    if (msg != null)
                        m_TimeWatch.AllDays[day].Comment = msg;
                    return;
                case eColumn.Arrival:
                case eColumn.Leaving:
                    ArrivalOrLeavingPressed(i_E, day);
                    return;
                case eColumn.DayType:
                    string chosneDayType = (string) monthGridView.Rows[day].Cells[i_E.ColumnIndex].Value;
                    msg = new GetDayTypeWindowForm(chosneDayType).ShowDialog();
                    if (!string.IsNullOrEmpty(msg))
                        m_TimeWatch.AllDays[day].DayType = DayTypeFactory.Get(msg);
                    return;
            }
        }