private void LoadEditors() { if (_current != null) { //calcolo le proprietà dello stato dell'appuntamento _current.CalculateAppointmentInfo(Properties.Settings.Default.Main_DeadlineDaysBefore); SetAppointmentStatusInfoData(); //inserisco i parametri abituali txtSub.EditValue = _current.Subject; txtCust.EditValue = _current.Customer; //tengo il cliente sincronizzto con la button edit _customer = _current.Customer; dtpIni.EditValue = _current.StartDate.Date; dtpFin.EditValue = _current.EndDate.Date; cboPriority.EditValue = _current.Priority.ToString(); cboState.EditValue = _current.ActivityState.ToString(); spPerc.EditValue = _current.PercentageCompleteness; txtNote.EditValue = _current.Description; if (_current.OutcomeDate == DateTime.MinValue) { dtpOut.EditValue = null; } else { dtpOut.EditValue = _current.OutcomeDate; } cboOut.EditValue = _current.Outcome; txtNoteRapp.EditValue = _current.OutcomeDescription; //chkClosed.Checked = _current.IsClosed; } }
private object CreateDummyTask() { MyTask c = new MyTask(); //inserisco i parametri abituali c.Subject = txtSub.Text; //_current.Resource = cboZon.SelectedItem as Resource; c.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)); c.StartDate = h1.Start; //artificio per evitare l'arrotondamento dei comandi ado su sql c.EndDate = h1.Finish.AddMinutes(-1); c.Description = txtNote.Text; c.Priority = (PriorityType)Enum.Parse(typeof(PriorityType), cboPriority.Text); c.ActivityState = (ActivityState)Enum.Parse(typeof(ActivityState), cboState.Text); c.PercentageCompleteness = Convert.ToInt32(spPerc.EditValue); if (dtpOut.EditValue == null) { c.OutcomeDate = DateTime.MinValue; } else { c.OutcomeDate = dtpOut.DateTime; } c.Outcome = cboOut.SelectedItem as Outcome; c.OutcomeDescription = txtNoteRapp.Text; c.CalculateAppointmentInfo(Properties.Settings.Default.Main_DeadlineDaysBefore); return(c); }