private void mnu_CopyToOtherDate_Click(object sender, EventArgs e) { if (GridView.SelectedCells != null && GridView.SelectedCells.Count == 1) { DataGridViewCell cell = GridView.SelectedCells[0]; if (_DateColumns.Contains(GridView.Columns[cell.ColumnIndex])) { DateTime dt = Convert.ToDateTime(GridView.Columns[cell.ColumnIndex].Tag); Staff staff = GridView.Rows[cell.RowIndex].Tag as Staff; List <Shift> shifts = cell.Tag as List <Shift>; FrmCopyToDate frm = new FrmCopyToDate(); frm.Staff = staff; frm.SourceDate = dt; frm.SourceShifts = shifts; if (frm.ShowDialog() == DialogResult.OK) { ShiftArrangeSearchCondition con = new ShiftArrangeSearchCondition(); con.StaffID = staff.ID; con.ShiftDate = new DatetimeRange(ucDateTimeInterval1.StartDateTime, ucDateTimeInterval1.EndDateTime); List <ShiftArrange> items = (new ShiftArrangeBLL(AppSettings.CurrentSetting.ConnectUri)).GetItems(con).QueryObjects; ShowUserShiftArrangesOnRow(staff, items, GridView.Rows[cell.RowIndex]); } } } }
private void mnu_CopyToOtherDate_Click(object sender, EventArgs e) { if (GridView.SelectedCells != null && GridView.SelectedCells.Count == 1) { DataGridViewCell cell = GridView.SelectedCells[0]; if (_DateColumns.Contains(GridView.Columns[cell.ColumnIndex])) { DateTime dt = Convert.ToDateTime(GridView.Columns[cell.ColumnIndex].Tag); Staff staff = GridView.Rows[cell.RowIndex].Tag as Staff; List<Shift> shifts = cell.Tag as List<Shift>; FrmCopyToDate frm = new FrmCopyToDate(); frm.Staff = staff; frm.SourceDate = dt; frm.SourceShifts = shifts; if (frm.ShowDialog() == DialogResult.OK) { ShiftArrangeSearchCondition con = new ShiftArrangeSearchCondition(); con.StaffID = staff.ID; con.ShiftDate = new DatetimeRange(ucDateTimeInterval1.StartDateTime, ucDateTimeInterval1.EndDateTime); List<ShiftArrange> items = (new ShiftArrangeBLL(AppSettings.CurrentSetting.ConnectUri)).GetItems(con).QueryObjects; ShowUserShiftArrangesOnRow(staff, items, GridView.Rows[cell.RowIndex]); } } } }