private void schedulerControl1_AppointmentResized(object sender, AppointmentResizeEventArgs e) { bool edit = false; Result res = new Result(); object[] OldObj = new object[8]; OldObj[0] = ProdType; OldObj[1] = ProdNo; OldObj[2] = Static.ToStr(e.SourceAppointment.ResourceId); OldObj[3] = e.SourceAppointment.Description; OldObj[4] = e.SourceAppointment.Subject; OldObj[5] = e.SourceAppointment.Start; OldObj[6] = e.SourceAppointment.End; OldObj[7] = e.SourceAppointment.LabelId; object[] obj = new object[8]; obj[0] = ProdType; obj[1] = ProdNo; obj[2] = Static.ToStr(e.SourceAppointment.ResourceId); obj[3] = e.SourceAppointment.Description; obj[4] = e.SourceAppointment.Subject; obj[5] = e.EditedAppointment.Start; obj[6] = e.EditedAppointment.End; obj[7] = e.SourceAppointment.LabelId; res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 210, 130124, 130124, new object[] { OldObj, obj }); if (res.ResultNo != 0) { MessageBox.Show(res.ResultNo + " : " + res.ResultDesc); } }
protected virtual void AppointmentResizeHandler(object sender, AppointmentResizeEventArgs e) { int borderPos = e.ResizedSide == ResizedSide.AtStartTime ? TimeCellViewInfo.Bounds.Y : TimeCellViewInfo.Bounds.Y + TimeCellViewInfo.Bounds.Height; if (Math.Abs(MousePosition.Y - borderPos) > 1) { TimeSpan cellTimeShift = GetCellTimeShift(); if (e.ResizedSide == ResizedSide.AtStartTime) { if (e.SourceAppointment.End > e.HitInterval.Start + cellTimeShift) { e.EditedAppointment.Start = e.HitInterval.Start + cellTimeShift; e.EditedAppointment.End = e.SourceAppointment.End; } } else { if (e.HitInterval.Start + cellTimeShift > e.SourceAppointment.Start) { e.EditedAppointment.Start = e.SourceAppointment.Start; e.EditedAppointment.End = e.HitInterval.Start + cellTimeShift; } } e.Handled = true; } }
private void schedulerControl1_AppointmentResizing(object sender, AppointmentResizeEventArgs e) { if (schedulerControl1.ActiveViewType == SchedulerViewType.Day) { Point mousePosition = schedulerControl1.PointToClient(Form.MousePosition); SchedulerHitInfo shi = schedulerControl1.ActiveView.ViewInfo.CalcHitInfo(mousePosition, true); int borderPos = e.ResizedSide == ResizedSide.AtStartTime ? shi.ViewInfo.Bounds.Y : shi.ViewInfo.Bounds.Y + shi.ViewInfo.Bounds.Height; if (Math.Abs(mousePosition.Y - borderPos) > 1) { double perc = (double)(mousePosition.Y - shi.ViewInfo.Bounds.Y) / (double)shi.ViewInfo.Bounds.Height; TimeSpan timetoAdd = TimeSpan.FromMinutes(e.HitInterval.Duration.TotalMinutes * perc); if (e.ResizedSide == ResizedSide.AtStartTime) { e.EditedAppointment.Start = e.HitInterval.Start + timetoAdd; e.EditedAppointment.End = e.SourceAppointment.End; } else { e.EditedAppointment.Start = e.SourceAppointment.Start; e.EditedAppointment.End = e.HitInterval.Start + timetoAdd; } e.Handled = true; } } }
public void OnAppointmentResizing(object sender, AppointmentResizeEventArgs e) { if (!RolesAndOrPermissions.CheckMatchAny(new[] { JarsRoles.Admin, JarsRoles.User, JarsRoles.Manager, JarsRoles.PowerUser })) { e.Allow = false; } }
/// <summary> /// 일정의 duration을 변경하였을 경우 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void schedulerControl_AppointmentResized(object sender, AppointmentResizeEventArgs e) { if (e.EditedAppointment.Start.Date.CompareTo(DateTime.Now) > 0 || e.EditedAppointment.End.Date.CompareTo(DateTime.Now) > 0) { if (e.EditedAppointment.Start.Day.Equals(e.EditedAppointment.End.Day))//시작일과 종료일이 다를수는 없음 { string start = e.EditedAppointment.Start.ToString("yyyy-MM-dd HH:mm:ss"); string end = e.EditedAppointment.End.ToString("yyyy-MM-dd HH:mm:ss"); if (CheckDuplicateSchedule(e.EditedAppointment.Description.Split(' ')[0], e.EditedAppointment.Start.ToString("yyyy-MM-dd HH:mm:ss"), start, end, e.EditedAppointment.LabelId.ToString())) {//중복검사 EditScheduleTime(e.EditedAppointment.LabelId.ToString(), e.EditedAppointment.Start.ToString("yyyy-MM-dd HH:mm:ss"), e.EditedAppointment.End.ToString("yyyy-MM-dd HH:mm:ss")); } else//스케쥴이 겹칠 경우 { XtraMessageBox.Show("해당 자산번호는 입력된 일시에 사용중입니다.", "안내", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else//스케쥴을 하루가 넘길 경우 { XtraMessageBox.Show("일자를 수정할 수 없습니다.", "안내", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { XtraMessageBox.Show("현시간 이전의 일정을 수정할 수 없습니다", "안내", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void SchedulerControl1_AppointmentResized(object sender, AppointmentResizeEventArgs e) { var app = e.EditedAppointment.Id as MyAppointment; if (app != null) { app.Resized(e); } }
internal void Resized(AppointmentResizeEventArgs e) { if (Changed != null) { var app = new AppTimeInformation(e.EditedAppointment); app.Allow = e.Allow; Changed(app); e.Allow = app.Allow; } }
private void schedulerControl1_AppointmentResized(object sender, AppointmentResizeEventArgs e) { var mail = new EnvioMailObject(); if (!PermitirModificarVisita(e.SourceAppointment)) { e.Allow = false; e.Handled = true; return; } string moveEventMsg = "Actualizar el evento en horario {0} - {1} a las {2} - {3} ."; string msg = string.Format(moveEventMsg, e.SourceAppointment.Start.ToShortTimeString(), e.SourceAppointment.End.ToShortTimeString(), e.EditedAppointment.Start.ToShortTimeString(), e.EditedAppointment.End.ToShortTimeString()); if (XtraMessageBox.Show(msg + "\r\nProceder?", "Mi Calendario", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { e.Allow = false; e.Handled = true; return; } clsVisita visita = LogicaNegocios.Calendarios.clsCalendarios.ObtenerVisitaPorId(Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"])); visita.FechaHoraComienzo = e.EditedAppointment.Start; visita.FechaHoraTermino = e.EditedAppointment.End; visita.UsuarioOrganizador = Base.Usuario.UsuarioConectado.Usuario; visita.Vendedor = Base.Usuario.UsuarioConectado.Usuario; ResultadoTransaccion res = LogicaNegocios.Calendarios.clsCalendarios.GuardarVisita(visita); if (res.Estado == Entidades.Enums.Enums.EstadoTransaccion.Rechazada) { MessageBox.Show(res.Descripcion, "Calendario", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Allow = false; e.Handled = true; return; } mail.ModificarVisitaOutlook(visita, e.SourceAppointment.Start, e.SourceAppointment.End); //Utils.EnvioEmail.ModificarVisitaOutlook(visita,e.SourceAppointment.Start,e.SourceAppointment.End); // LoadDataCalendar(); }
protected virtual void AppointmentResizeHandler(object sender, AppointmentResizeEventArgs e) { HitTimeCellInfo hitTimeCellInfo = HitTimeCellInfo; if (hitTimeCellInfo == null) { return; } Rect timeCellBounds = hitTimeCellInfo.Bounds; double borderPos = 0d; double mousePosition = 0d; if (control.ActiveViewType == SchedulerViewType.Timeline) { mousePosition = MousePosition.X; borderPos = e.ResizedSide == ResizedSide.AtStartTime ? timeCellBounds.X : timeCellBounds.X + timeCellBounds.Width; } else { borderPos = e.ResizedSide == ResizedSide.AtStartTime ? timeCellBounds.Y : timeCellBounds.Y + timeCellBounds.Height; mousePosition = MousePosition.Y; } if (Math.Abs(mousePosition - borderPos) > 1) { TimeSpan cellTimeShift = hitTimeCellInfo.TimeShift; if (e.ResizedSide == ResizedSide.AtStartTime) { if (e.SourceAppointment.End > e.HitInterval.Start + cellTimeShift) { e.EditedAppointment.Start = e.HitInterval.Start + cellTimeShift; e.EditedAppointment.End = e.SourceAppointment.End; } } else if (e.HitInterval.Start + cellTimeShift > e.SourceAppointment.Start) { e.EditedAppointment.Start = e.SourceAppointment.Start; e.EditedAppointment.End = e.HitInterval.Start + cellTimeShift; } e.Handled = true; } }
private void schRezervasyon_AppointmentResized(object sender, AppointmentResizeEventArgs e) { }
public void OnAppointmentResized(object sender, AppointmentResizeEventArgs e) { SaveAppointmentEntity(e.EditedAppointment); }
private void schedulerControl1_AppointmentResized(object sender, AppointmentResizeEventArgs e) { e.Allow = true; e.Handled = true; }
/// <summary> /// 调整时间段的长度 /// </summary> private void schedulerPlanTask_AppointmentResized(object sender, AppointmentResizeEventArgs e) { try { int autoIdInt = DataTypeConvert.GetInt(e.EditedAppointment.ResourceId); DateTime beginDate = e.EditedAppointment.Start; DateTime endDate = e.EditedAppointment.End.AddDays(-1); if (beginDate > endDate) { MessageHandler.ShowMessageBox("计划开始日期必须小于计划结束日期,请重新操作。"); e.Allow = false; e.Handled = true; return; } DataRow[] olddrs = TableProjectPlanTask.Select(string.Format("AutoId = {0}", autoIdInt)); if (olddrs.Length > 0) { if (!CheckIsPlanEdit(olddrs[0])) { e.Allow = false; e.Handled = true; return; } } bSProjectPlanTask.EndEdit(); DataRow dr = ((DataRowView)bSProjectPlanTask.Current).Row; if (dr.RowState != DataRowState.Unchanged) { if (MessageHandler.ShowMessageBox_YesNo("确认是否保存当前行信息?") == DialogResult.Yes) { if (!editForm.btnSave_Click()) { e.Allow = false; e.Handled = true; return; } } else { dr.RejectChanges(); editForm.Set_Button_State(true); editForm.Set_EditZone_ControlReadOnly(true); } } else { editForm.Set_Button_State(true); editForm.Set_EditZone_ControlReadOnly(true); } planTaskDAO.UpdateProjectPlanTask_PlanDate(autoIdInt, beginDate, endDate); e.Allow = false; e.Handled = true; editForm.btnRefresh_Click(null, null); DataRow[] newdrs = TableProjectPlanTask.Select(string.Format("AutoId = {0}", autoIdInt)); if (newdrs.Length > 0) { bSProjectPlanTask.Position = TableProjectPlanTask.Rows.IndexOf(newdrs[0]); bSProjectPlanTask_PositionChanged(null, null); } } catch (Exception ex) { ExceptionHandler.HandleException(this.Text + "--调整时间段的长度错误。", ex); } }