public MedicalAppointment(DateTime Date, string DoctorId, string PatientId) : base(true) { this.Date = Date; this.DoctorId = DoctorId; this.PatientId = PatientId; this.Doctor = AppointmentUtils.JoinDoctor(DoctorId.Trim()); this.Patient = AppointmentUtils.JoinPatient(PatientId.Trim()); }
private void PrepareForLoading() { //Carico le combo LoadComboZone(); LoadComboCausali(); LoadComboOperatori(); LoadComboEsiti(); //imposto il cliente, la zona, il luogo di default se il cliente è presente txtSub.EditValue = Properties.Settings.Default.Main_CalendarSubject; if (_customer != null) { txtCust.EditValue = _customer; txtLoc.EditValue = string.Format("{0} {1} {2}", _customer.Residenza.Via, _customer.Residenza.Cap, _customer.Residenza.Comune.Descrizione); cboZon.EditValue = _customer.Resource; txtNote.EditValue = _customer.OtherDataSummary; } else { txtCust.EditValue = null; txtLoc.EditValue = ""; txtNote.EditValue = ""; } //carico la data e l'ora iniziale AppointmentDateValidator v = AppointmentUtils.GetProposedDate(); dtpIni.EditValue = v.StartDate; dtpFin.EditValue = v.EndDate; timini.Time = new DateTime(v.StartDate.TimeOfDay.Ticks); timfin.Time = new DateTime(v.EndDate.TimeOfDay.Ticks); ////imposto le note //txtNote.EditValue = ""; //imposto i valori per il rapporto dtpOut.EditValue = null; chkClosed.Checked = false; txtNoteRapp.EditValue = ""; }
public PeriodAppointmentDTO(PeriodAppointmentDTOEnum state, DataRange range, bool findAlsoOverlappedAppointments, bool noPeriod) { _findAlsoOverlappedAppointments = findAlsoOverlappedAppointments; _state = state; _range = range; _noPeriod = noPeriod; if (_range == null) { _range = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now, DateTime.Now)); } if (_range.IsEmpty()) { _range = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now, DateTime.Now)); } }
private void SaveOrUpdate() { //inserisco i parametri abituali _current.Subject = txtSub.Text; //_current.Resource = cboZon.SelectedItem as Resource; _current.Customer = txtCust.EditValue as Customer; //_current.Location = txtLoc.Text; //_current.Label = cboCaus.SelectedItem as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Label; //_current.Operator = cboOp.SelectedItem as Operator; DataRange h1 = AppointmentUtils.CreateRangeForQuery(new DataRange(dtpIni.DateTime.Date, dtpFin.DateTime.Date)); _current.StartDate = h1.Start; //artificio per evitare l'arrotondamento dei comandi ado su sql _current.EndDate = h1.Finish.AddMinutes(-1); _current.Description = txtNote.Text; _current.Priority = (PriorityType)Enum.Parse(typeof(PriorityType), cboPriority.Text); _current.ActivityState = (ActivityState)Enum.Parse(typeof(ActivityState), cboState.Text); _current.PercentageCompleteness = Convert.ToInt32(spPerc.EditValue); if (dtpOut.EditValue == null) { _current.OutcomeDate = DateTime.MinValue; } else { _current.OutcomeDate = dtpOut.DateTime; } _current.Outcome = cboOut.SelectedItem as Outcome; _current.OutcomeDescription = txtNoteRapp.Text; TaskHandler h = new TaskHandler(); h.SaveOrUpdate(_current); _current.CalculateAppointmentInfo(Properties.Settings.Default.Main_DeadlineDaysBefore); }
public WIN.TECHNICAL.PERSISTENCE.AbstractBoolCriteria GenerateSql() { bool modified = false; CompositeCriteria c = new CompositeCriteria(AbstractBoolCriteria.Operatore.AndOp); if (!string.IsNullOrEmpty(_subject)) { c.AddCriteria(Criteria.Matches("Subject", _subject, DataAccessServices.Instance().PersistenceFacade.DBType)); modified = true; } if (!string.IsNullOrEmpty(_priority)) { PriorityType t = (PriorityType)Enum.Parse(typeof(PriorityType), _priority); c.AddCriteria(Criteria.Equal("Priority", Convert.ToInt32(t).ToString())); modified = true; } if (!_range.IsEmpty()) { DataRange r = AppointmentUtils.CreateRangeForQuery(_range); c.AddCriteria(Criteria.DateTimeContained("OutcomeDate", r.Start, r.Finish, DataAccessServices.Instance().PersistenceFacade.DBType)); modified = true; } CompositeCriteria c1 = CreateStapeCriteria(); if (c1 != null) { c.AddCriteria(c1); modified = true; } if (modified) { return(c); } return(null); }
private void schedulerControl1_InitNewAppointment(object sender, AppointmentEventArgs e) { //////carico la data e l'ora iniziale e.Appointment.AllDay = false; e.Appointment.Subject = Properties.Settings.Default.Main_CalendarSubject; if (schedulerControl1.ActiveViewType != SchedulerViewType.Day && schedulerControl1.ActiveViewType != SchedulerViewType.WorkWeek) { AppointmentDateValidator v = AppointmentUtils.GetProposedDate(e.Appointment.Start); e.Appointment.Start = v.StartDate; e.Appointment.End = v.EndDate; } //dtpin.EditValue = v.StartDate; //dtpfin.EditValue = v.EndDate; //timin.Time = new DateTime(v.StartDate.TimeOfDay.Ticks); //timfin.Time = new DateTime(v.EndDate.TimeOfDay.Ticks); }
public WIN.TECHNICAL.PERSISTENCE.AbstractBoolCriteria GenerateSql() { if (_noPeriod) { return(null); } DataRange r; switch (_state) { case PeriodAppointmentDTOEnum.Prossimi_Sei_Mesi: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(1), DateTime.Now.AddDays(1).AddMonths(6))); break; case PeriodAppointmentDTOEnum.Prossimi_Tre_Mesi: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(1), DateTime.Now.AddDays(1).AddMonths(3))); break; case PeriodAppointmentDTOEnum.Prossimo_Mese: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(1), DateTime.Now.AddDays(1).AddMonths(1))); break; case PeriodAppointmentDTOEnum.Prossime_Due_Settimane: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(1), DateTime.Now.AddDays(15))); break; case PeriodAppointmentDTOEnum.Prossima_Settimana: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(1), DateTime.Now.AddDays(8))); break; case PeriodAppointmentDTOEnum.Domani: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(1), DateTime.Now.AddDays(1))); break; case PeriodAppointmentDTOEnum.Oggi: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now, DateTime.Now)); break; case PeriodAppointmentDTOEnum.Ultima_Settimana: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(-8), DateTime.Now.AddDays(-1))); break; case PeriodAppointmentDTOEnum.Ultime_Due_Settimane: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(-15), DateTime.Now.AddDays(-1))); break; case PeriodAppointmentDTOEnum.Ultimo_Mese: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(-1).AddMonths(-1), DateTime.Now.AddDays(-1))); break; case PeriodAppointmentDTOEnum.Ultimi_Tre_Mesi: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(-1).AddMonths(-3), DateTime.Now.AddDays(-1))); break; case PeriodAppointmentDTOEnum.Ultimi_Sei_Mesi: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now.AddDays(-1).AddMonths(-6), DateTime.Now.AddDays(-1))); break; case PeriodAppointmentDTOEnum.Periodo: r = AppointmentUtils.CreateRangeForQuery(_range); break; default: r = AppointmentUtils.CreateRangeForQuery(new DataRange(DateTime.Now, DateTime.Now)); break; } if (_findAlsoOverlappedAppointments) { CompositeCriteria c = new CompositeCriteria(AbstractBoolCriteria.Operatore.AndOp); c.AddCriteria(Criteria.DateRangeIntersects("StartDate", "EndDate", r.Start, r.Finish, DataAccessServices.Instance().PersistenceFacade.DBType)); return(c); } else { CompositeCriteria c = new CompositeCriteria(AbstractBoolCriteria.Operatore.AndOp); c.AddCriteria(Criteria.DateTimeContained("StartDate", r.Start, r.Finish, DataAccessServices.Instance().PersistenceFacade.DBType)); return(c); } }
SchedulerDragData GetDragData(GridView view) { int[] selection = view.GetSelectedRows(); if (selection == null) { return(null); } AppointmentBaseCollection appointments = new AppointmentBaseCollection(); int count = selection.Length; for (int i = 0; i < count; i++) { int rowIndex = selection[i]; MyTask myTask = view.GetRow(rowIndex) as MyTask; //imposto una variabile a livello //di modulo per il richiamo alle successive azioni postdragdrop if (Properties.Settings.Default.Main_RenewActivityAfterDragDrop || Properties.Settings.Default.Main_MarkActivityCompletedafterDragDrop) { _draggedTask = myTask; } else { _draggedTask = null; } if (myTask == null) { break; } Appointment apt = schedulerStorage1.CreateAppointment(AppointmentType.Normal); apt.AllDay = false; if (schedulerControl1.ActiveViewType != SchedulerViewType.Day && schedulerControl1.ActiveViewType != SchedulerViewType.WorkWeek) { AppointmentDateValidator v = AppointmentUtils.GetProposedDate(apt.Start); apt.Start = v.StartDate; apt.End = v.EndDate; } else { apt.Duration = TimeSpan.FromHours(0.5); } apt.Subject = myTask.Subject; //apt.LabelId = (int)view.GetRowCellValue(rowIndex, "Severity"); //apt.StatusId = (int)view.GetRowCellValue(rowIndex, "Priority"); //WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource r = new ResourceHandler().GetAll()[0] as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource; ////apt.ResourceId = r.Id; //if (schedulerControl1.GroupType == SchedulerGroupType.None) // apt.SetValue(schedulerStorage1, "Resource", r); apt.SetValue(schedulerStorage1, "Label", new LabelHandler().GetAll()[0]); if (myTask.Customer != null) { apt.SetValue(schedulerStorage1, "Customer", myTask.Customer); Customer c = myTask.Customer; apt.Location = string.Format("{0} {1} {2}", c.Residenza.Via, c.Residenza.Cap, c.Residenza.Comune.Descrizione); if (string.IsNullOrEmpty(myTask.Description)) { apt.Description = c.OtherDataSummary; } } if (!string.IsNullOrEmpty(myTask.Description)) { apt.Description = myTask.Description; } appointments.Add(apt); } return(new SchedulerDragData(appointments, 0)); }