Example #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int rowHandle = 0;

            if (ShiftView.FocusedRowHandle < 0)
            {
                MessageService.ShowMessage("${res:FanHai.Hemera.Addin.SelectRemaind}", "${res:Global.SystemInfo}");
            }
            else
            {
                rowHandle = ShiftView.FocusedRowHandle;
                Shift shift = new Shift();
                shift.ShiftKey = this.ShiftView.GetRowCellValue(rowHandle, shift_key).ToString();
                ShiftEditDialog shiftDialog = new ShiftEditDialog(_schedule.ScheduleKey, shift);
                if (DialogResult.OK == shiftDialog.ShowDialog())
                {
                    ShiftView.SetRowCellValue(rowHandle, shift_name, shift.ShiftName);
                    ShiftView.SetRowCellValue(rowHandle, start_time, shift.StartTime);
                    ShiftView.SetRowCellValue(rowHandle, end_time, shift.EndTime);
                    ShiftView.SetRowCellValue(rowHandle, over_day, shift.OverDay);
                }
            }
        }