Example #1
0
 private void ToggleRecurrenceButton()
 {
     if (!apptRow.IsApptRecurrenceIdNull())
     {
         UIHelper.ToggleUIButton(RecurrenceUIButton, !apptRow.ApptRecurrenceRow.RecurrenceRemoved);
         startDateCalendarCombo.Enabled = apptRow.ApptRecurrenceRow.RecurrenceRemoved;
         endDateCalendarCombo.Enabled   = apptRow.ApptRecurrenceRow.RecurrenceRemoved;
     }
     else
     {
         UIHelper.ToggleUIButton(RecurrenceUIButton, !apptRow.IsApptRecurrenceIdNull());
         startDateCalendarCombo.Enabled = apptRow.IsApptRecurrenceIdNull();
         endDateCalendarCombo.Enabled   = apptRow.IsApptRecurrenceIdNull();
     }
     subjectEditBox.Focus();
 }
Example #2
0
        protected override void BeforeUpdate(DataRow dr)
        {
            BeforeChange("Subject", dr);

            atriumDB.AppointmentRow apptRow = (atriumDB.AppointmentRow)dr;

            if (!apptRow.IsIntervalNull())
            {
                officeDB.OfficerRow workingas = myA.AtMng.WorkingAsOfficer;
                foreach (atriumDB.AttendeeRow att in apptRow.GetAttendeeRows())
                {
                    if (att.ContactId == workingas.OfficerId || att.RowState == DataRowState.Added)
                    {
                        att.Interval            = apptRow.Interval;
                        att.NotificationDismiss = false;
                    }
                }
            }

            //if (!apptRow.IsApptRecurrenceIdNull() && apptRow.OriginalRecurrence == true)
            //{
            //    apptRow.ApptRecurrenceRow.updateDate = DateTime.Now;
            //}
            if (!apptRow.IsApptRecurrenceIdNull())
            {
                if (apptRow.ApptRecurrenceRow.RecurrenceRemoved)
                {
                    apptRow.ApptRecurrenceRow.Delete();
                    apptRow.SetApptRecurrenceIdNull();
                    myA.DB.ApptRecurrence.AcceptChanges();
                }
            }
        }
Example #3
0
        private void schedule1_AppointmentRead(object sender, Janus.Windows.Schedule.AppointmentEventArgs e)
        {
            DataRowView drv = (DataRowView)e.Appointment.DataRow;

            atriumDB.AppointmentRow apptRow = (atriumDB.AppointmentRow)drv.Row;

            if (!apptRow.IsApptRecurrenceIdNull())
            {
                e.Appointment.ImageIndex1 = 3;
            }
        }
Example #4
0
 private void GetOriginalRecurrenceAppointment(FileManager fm)
 {
     atriumDB.AppointmentRow apptr = (atriumDB.AppointmentRow)((DataRowView)AppointmentBindingSource.Current).Row;
     if (!apptr.IsApptRecurrenceIdNull())
     {
         DataRow[] drs = fm.DB.Appointment.Select("ApptRecurrenceId=" + apptr.ApptRecurrenceId.ToString() + " AND OriginalRecurrence='True'");
         if (drs.Length > 0)
         {
             atriumDB.AppointmentRow origRecurrApptRow = (atriumDB.AppointmentRow)drs[0];
             AppointmentBindingSource.Position = AppointmentBindingSource.Find("ApptId", origRecurrApptRow.ApptId);
         }
     }
 }
Example #5
0
        private void AddRecurrenceSymbol()
        {
            foreach (Janus.Windows.Schedule.ScheduleAppointment apptScheduled in schedule1.Appointments)
            {
                DataRowView             drv     = (DataRowView)apptScheduled.DataRow;
                atriumDB.AppointmentRow apptRow = (atriumDB.AppointmentRow)drv.Row;

                if (!apptRow.IsApptRecurrenceIdNull())
                {
                    apptScheduled.ImageIndex1 = 3;
                }
            }
        }
Example #6
0
        private void Init()
        {
            DataTable dtAppRecurrenceType = fmCurrent.Codes("vApptRecurrenceType");

            UIHelper.ComboBoxInit(dtAppRecurrenceType, RecurrenceUIMultiDropDown, fmCurrent);

            if (originalApptRow.IsApptRecurrenceIdNull() || originalApptRow.ApptRecurrenceRow.RecurrenceRemoved)
            {
                RemoveRecurrenceUIButton.Enabled        = false;
                RecurrenceUIMultiDropDown.SelectedValue = RecurrenceFrequency.Daily;
                AdjustDropDownNumbers();
            }
            else
            {
                AdjustRecurrencePanels(originalApptRow.ApptRecurrenceRow.ApptRecurrenceTypeId);
                RecurrenceUIMultiDropDown.SelectedValue = originalApptRow.ApptRecurrenceRow.ApptRecurrenceTypeId;
                AdjustDropDownNumbers();
                SetFormValues();
            }
            RecurrenceUIMultiDropDown.Focus();
        }
Example #7
0
        protected override void AfterChange(DataColumn dc, DataRow row)
        {
            atriumDB.AppointmentRow dr = (atriumDB.AppointmentRow)row;
            if (!dr.IsApptRecurrenceIdNull() && dr.OriginalRecurrence == true && dr.ApptRecurrenceRow != null)
            {
                dr.ApptRecurrenceRow.updateDate = DateTime.Now;
            }
            switch (dc.ColumnName)
            {
            case "StartDateLocal":

                if (!dr.IsEndDateLocalNull() && !dr.IsStartDateLocalNull() && !dr.IsNull("EndDate") && !dr.IsNull("StartDate"))
                {
                    //keep duration
                    TimeSpan ts = dr.StartDate.DateTime.Subtract(dr.EndDate.DateTime);
                    dr.EndDateLocal = dr.StartDateLocal.Add(ts.Duration());
                    dr.EndDate      = dr.EndDateLocal.ToUniversalTime();
                }

                dr.StartDate = dr.StartDateLocal.ToUniversalTime();

                dr.EndEdit();
                break;

            case "EndDateLocal":
                if (!dr.IsEndDateLocalNull() && !dr.IsStartDateLocalNull() && !dr.IsNull("EndDate") && !dr.IsNull("StartDate"))
                {
                    if (dr.EndDateLocal <= dr.StartDateLocal)
                    {
                        dr.StartDateLocal = dr.EndDateLocal.AddHours(-1);
                    }
                }
                dr.EndDate = dr.EndDateLocal.ToUniversalTime();
                dr.EndEdit();
                break;
            }
        }