コード例 #1
0
ファイル: NewScheduler.aspx.cs プロジェクト: jehan2898/root
    protected void ASPxScheduler1_AppointmentsDeleted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
    {
        Appointment apt = (Appointment)e.Objects[0];

        //Delete Schedule
        DeleteSchedule objSchedule = new DeleteSchedule();

        objSchedule.Index         = 0;
        objSchedule.AppointmentID = Convert.ToInt32(apt.Id);
        switch (apt.Type)
        {
        case AppointmentType.ChangedOccurrence:
            break;

        case AppointmentType.DeletedOccurrence:
        case AppointmentType.Pattern:
            objSchedule.Index = apt.RecurrenceIndex;
            billSysDeleteBO.DeleteEventSchedular(objSchedule);
            break;

        case AppointmentType.Normal:
            billSysDeleteBO.DeleteEventSchedular(objSchedule);
            break;

        case AppointmentType.Occurrence:

            break;

        default:
            break;
        }
    }
コード例 #2
0
        private void AppointmentsDeletedExecute(DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
        {
            string LastMessage;

            for (int i = 0; i < e.Objects.Count; i++)
            {
                Appointment             deletedAppt = e.Objects[i] as Appointment;
                IHP_HARMONOGRAM_DZIENNY item        = context.IHP_HARMONOGRAM_DZIENNY.Local.FirstOrDefault(x => x.ID_IHP_HARMONOGRAM_DZIENNY == Convert.ToInt32(deletedAppt.Id));


                if (item != null)
                {
                    if (item.IHP_NAGLDOK > 0)
                    {
                        MessageBoxService.ShowMessage("WYSTAWIONO ZAMÓWIENIE - NIE MOŻNA USUNĄĆ");

                        return;
                    }

                    try
                    {
                        context.IHP_HARMONOGRAM_DZIENNY.Remove(item);
                        context.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        LastMessage = ex.ToString();
                        LogManager.WriteLogMessage(LogManager.LogType.Error, LastMessage);
                    }
                }
            }
        }
コード例 #3
0
    protected void ASPxScheduler1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
    {
        Appointment          apt     = (Appointment)e.Objects[0];
        ASPxSchedulerStorage storage = (ASPxSchedulerStorage)sender;

        storage.SetAppointmentId(apt, lastInsertedAppointmentId);
    }
コード例 #4
0
        void Storage_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
        {
            AppointmentBaseCollection appointments = e.Objects as AppointmentBaseCollection;

            foreach (Appointment appointment in appointments)
            {
                Debug.WriteLine(appointment.Subject);
            }
        }
    protected void ASPxScheduler1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
    {
        //int count = e.Objects.Count;
        //System.Diagnostics.Debug.Assert(count == 1);

        Appointment          apt     = (Appointment)e.Objects[0];
        ASPxSchedulerStorage storage = (ASPxSchedulerStorage)sender;

        storage.SetAppointmentId(apt, lastInsertedAppointmentId);
    }
コード例 #6
0
 private void schedulerStorage1_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     foreach (Appointment apt in e.Objects)
     {
         XPBaseObject o = apt.GetSourceObject(schedulerStorage1) as XPBaseObject;
         if (o != null)
         {
             o.Save();
         }
     }
 }
コード例 #7
0
        private void schedulerStoragePrenotazioni_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
        {
            foreach (Appointment item in e.Objects)
            {
                Prenotazione prenotazione = (item.GetSourceObject(this.schedulerStoragePrenotazioni) as Prenotazione);

                item.LabelId = Prenotazione.LabelDaControllare;
                item.Start   = prenotazione.FixStartDate();
                item.End     = prenotazione.EndDate;

                prenotazione.Notify();
            }
        }
コード例 #8
0
        //   https://www.devexpress.com/Support/Center/Example/Details/E4670
        private void AppointmentsModifiedExecute(DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
        {
            string LastMessage;

            try
            {
                context.SaveChanges();
                //      Refresh();
                RefreshCalendar();
            }

            catch (Exception ex)
            {
                LastMessage = ex.ToString();
                LogManager.WriteLogMessage(LogManager.LogType.Error, LastMessage);
            }
        }
    protected void ASPxScheduler1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
    {
        int count = e.Objects.Count;

        System.Diagnostics.Debug.Assert(count == lastInsertedIds.Count);

        ASPxSchedulerStorage storage = (ASPxSchedulerStorage)sender;

        for (int i = 0; i < count; i++)
        {
            Appointment apt           = (Appointment)e.Objects[i];
            int         appointmentId = lastInsertedIds[i];
            storage.SetAppointmentId(apt, appointmentId);
        }

        lastInsertedIds.Clear();
    }
コード例 #10
0
 private void SchedulerStorage_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     foreach (DevExpress.XtraScheduler.Appointment obj in e.Objects)
     {
         var app = new Appointment
         {
             Id          = obj.Id,
             AllDayEvent = obj.AllDay,
             Description = obj.Description,
             EndTime     = obj.End,
             LabelId     = obj.LabelId,
             Location    = obj.Location,
             ResourceId  = obj.ResourceId,
             StartTime   = obj.Start,
             StatusId    = obj.StatusId,
             Subject     = obj.Subject
         };
         ViewModel.AppointmentOnViewChanged(app);
     }
 }
コード例 #11
0
ファイル: CalendarForm.cs プロジェクト: tslekwadi/CDS
 private void schedulerStorage1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     try
     {
         foreach (Appointment apt in e.Objects)
         {
             DB.CAL_Calendar o = apt.GetSourceObject((SchedulerStorage)sender) as DB.CAL_Calendar;
             if (o != null)
             {
                 try
                 {
                     using (TransactionScope transaction = DataContext.GetTransactionScope())
                     {
                         BL.EntityController.SaveCAL_Calendar(o, DataContext);
                         DataContext.SaveChangesEntityCalendarContext();
                         schedulerStorage1.SetAppointmentId(apt, o.Id);
                         RefreshData();
                         DataContext.CompleteTransaction(transaction);
                     }
                     DataContext.EntityCalendarContext.AcceptAllChanges();
                 }
                 catch (Exception ex)
                 {
                     DataContext.EntityCalendarContext.RejectChanges();
                     HasErrors = true;
                     if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                     {
                         throw ex;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
         {
             throw ex;
         }
     }
 }
コード例 #12
0
        private void schedulerStorage1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
        {
            //gets the newly created Devexpress appointment;
            DevExpress.XtraScheduler.Appointment app = e.Objects[0] as DevExpress.XtraScheduler.Appointment;


            //*********************************************************
            //questo codice è inserito per risolvere il problema dell'assegnazione della risorsa
            //dopo il grag drop
            DevExpress.XtraScheduler.Resource ee = app.ResourceId as DevExpress.XtraScheduler.Resource;
            //questa situazione si verifica quando lo scheduler non è stato in grado
            //di assegnare una risorsa all'appuntamento creato nella funzione GetDragData
            //e pertanto assegna la risorsa "All" all'appuntamento
            if (ee != null)
            {
                Customer ccc = app.GetValue(schedulerStorage1, "Customer") as Customer;
                if (ccc != null)
                {
                    app.SetValue(schedulerStorage1, "Resource", ccc.Resource);
                    app.ResourceId = ccc.Resource.Id;
                }
                else
                {
                    WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource t = new ResourceHandler().GetAll()[0] as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource;
                    app.SetValue(schedulerStorage1, "Resource", t);
                    app.ResourceId = t.Id;
                }
            }
            else
            {
                app.SetValue(schedulerStorage1, "Resource", new ResourceHandler().GetElementById(app.ResourceId.ToString()) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource);
            }
            //****************************************************************++



            //imposto per sicurezza il campo allday a false;
            app.AllDay = false;

            ////i get my custom object
            MyAppointment a = app.GetSourceObject(schedulerStorage1) as MyAppointment;



            ////i save on my db
            AppointmentHandler h = new AppointmentHandler();

            try
            {
                h.SaveOrUpdate(a);
            }
            catch (Exception ex)
            {
                WIN.SCHEDULING_APP.GUI.Utility.ErrorHandler.Show(ex);

                return;
            }


            //notifico l'id all'oggetto appena creato
            Key newId = a.Key;

            app.SetValue(schedulerStorage1, "Key", newId);


            //Appointment app1 = app.Copy();
            //app1.Start = DateTime.Now.AddHours(2);

            //schedulerStorage1.Appointments.Add(app1);

            //foreach (Appointment item in schedulerStorage1 .Appointments.Items  )
            //{
            //    MyAppointment a1 = app.GetSourceObject(schedulerStorage1) as MyAppointment;

            //}
        }
コード例 #13
0
 private void schedulerStorage1_AppointmentsChangedInsertedDeleted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     carsXtraSchedulingEntities.SaveChanges();
 }
 private void OnApptChangedInsertedDeleted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     this.carSchedulingTableAdapter.Update(this.carsDBDataSet);
     UpdateGridSelection();
 }
 private void schedulerStorage1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     this.eventsTableAdapter.Update(this.dsEvents);
     this.dsEvents.AcceptChanges();
 }
コード例 #16
0
ファイル: NewScheduler.aspx.cs プロジェクト: jehan2898/root
    protected void ASPxScheduler1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
    {
        //Task.Factory.StartNew(() =>
        //{
        Appointment apt = (Appointment)e.Objects[0];

        string[] clientData = apt.Location.Split(new char[] { '-' });
        if (clientData[2].Trim() != "null")
        {
            if (apt.Type == AppointmentType.Pattern)
            {
                OccurrenceCalculator      oc    = OccurrenceCalculator.CreateInstance(apt.RecurrenceInfo);
                TimeInterval              ttc   = new TimeInterval(apt.RecurrenceInfo.Start, apt.RecurrenceInfo.End.Add(apt.Duration));
                AppointmentBaseCollection appts = oc.CalcOccurrences(ttc, apt);

                foreach (Appointment item in appts)
                {
                    int index = item.RecurrenceIndex;
                    #region Data insert to TXN_CALENDAR
                    try
                    {
                        ArrayList         objAdd;
                        Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                        objAdd = new ArrayList();
                        objAdd.Add(_bill_Sys_Calender.GetCaseIDByPatient(clientData[2]));
                        objAdd.Add(item.Start);
                        objAdd.Add(item.Start.Hour + "." + item.Start.Minute);
                        objAdd.Add(apt.Description);
                        objAdd.Add(clientData[1]);
                        objAdd.Add("TY000000000000000003");
                        objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                        objAdd.Add(apt.Start.ToString("tt", CultureInfo.InvariantCulture));
                        int    endMin  = Convert.ToInt32(item.End.Minute);
                        int    endHr   = Convert.ToInt32(item.End.Hour);
                        string endTime = item.End.Hour + "." + item.End.Minute;
                        if (endMin >= 60)
                        {
                            endMin = endMin - 60;
                            endHr  = endHr + 1;
                            if (endHr > 12)
                            {
                                endHr = endHr - 12;
                                if (apt.End.Hour != 12)
                                {
                                    if (endTime == "AM")
                                    {
                                        endTime = "PM";
                                    }
                                    else if (endTime == "PM")
                                    {
                                        endTime = "AM";
                                    }
                                }
                            }
                            else if (endHr == 12)
                            {
                                if (apt.End.Hour != 12)
                                {
                                    if (endTime == "AM")
                                    {
                                        endTime = "PM";
                                    }
                                    else if (endTime == "PM")
                                    {
                                        endTime = "AM";
                                    }
                                }
                            }
                        }
                        objAdd.Add(endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString());
                        objAdd.Add(item.End.ToString("tt", CultureInfo.InvariantCulture));
                        objAdd.Add(apt.StatusId);
                        objAdd.Add(clientData[0]);
                        objAdd.Add(apt.Id);
                        objAdd.Add(index);
                        _bill_Sys_Calender.SaveEventFromSchedular(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                        index++;
                    }
                    catch (Exception ex)
                    {
                        Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                    }
                    #endregion
                }
                return;
            }
            else if (apt.Type == AppointmentType.Normal)
            {
                #region Data insert to TXN_CALENDAR
                try
                {
                    ArrayList         objAdd;
                    Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                    objAdd = new ArrayList();
                    objAdd.Add(_bill_Sys_Calender.GetCaseIDByPatient(clientData[2]));
                    objAdd.Add(apt.Start);
                    objAdd.Add(apt.Start.Hour + "." + apt.Start.Minute);
                    objAdd.Add(apt.Description);
                    objAdd.Add(clientData[1]);
                    objAdd.Add("TY000000000000000003");
                    objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    objAdd.Add(apt.Start.ToString("tt", CultureInfo.InvariantCulture));
                    int    endMin  = Convert.ToInt32(apt.End.Minute);
                    int    endHr   = Convert.ToInt32(apt.End.Hour);
                    string endTime = apt.End.Hour + "." + apt.End.Minute;
                    if (endMin >= 60)
                    {
                        endMin = endMin - 60;
                        endHr  = endHr + 1;
                        if (endHr > 12)
                        {
                            endHr = endHr - 12;
                            if (apt.End.Hour != 12)
                            {
                                if (endTime == "AM")
                                {
                                    endTime = "PM";
                                }
                                else if (endTime == "PM")
                                {
                                    endTime = "AM";
                                }
                            }
                        }
                        else if (endHr == 12)
                        {
                            if (apt.End.Hour != 12)
                            {
                                if (endTime == "AM")
                                {
                                    endTime = "PM";
                                }
                                else if (endTime == "PM")
                                {
                                    endTime = "AM";
                                }
                            }
                        }
                    }
                    objAdd.Add(endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString());
                    objAdd.Add(apt.End.ToString("tt", CultureInfo.InvariantCulture));
                    objAdd.Add(0);
                    objAdd.Add(clientData[0]);
                    objAdd.Add(apt.Id);
                    objAdd.Add(0);
                    _bill_Sys_Calender.SaveEventFromSchedular(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                }
                catch (Exception ex)
                {
                    Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                }
                #endregion
                return;
            }
            else if (apt.Type == AppointmentType.DeletedOccurrence)
            {
                //Deleted code in TXN_CALENDER_EVENTS
                DeleteSchedule objSchedule = new DeleteSchedule();
                objSchedule.Index         = apt.RecurrenceIndex;
                objSchedule.AppointmentID = Convert.ToInt32(apt.RecurrencePattern.Id);
                billSysDeleteBO.DeleteEventSchedular(objSchedule);
                return;
            }
            else if (apt.Type == AppointmentType.ChangedOccurrence)
            {
                return;
            }
        }
    }
 void Storage_AppointmentsModified(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     context.SaveChanges();
 }
コード例 #18
0
ファイル: Calender.cs プロジェクト: ayaRayan93/CarsManagment2
 private void OnAppointmentInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     appointmentDataAdapter.Update(schedulerDataSet.Tables["Appointments"]);
     schedulerDataSet.AcceptChanges();
 }
コード例 #19
0
 private void schedulerStorage1_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     myDataSet.AcceptChanges();
 }
コード例 #20
0
 private void schedulerStorage1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     CommitTask();
     //    schedulerStorage1.SetAppointmentId(((Appointment)e.Objects[0]), id);
 }
コード例 #21
0
 private void schedulerStorage_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     appointmentsTableAdapter.Update(alexLabDataSet);
     alexLabDataSet.AcceptChanges();
 }
コード例 #22
0
 private void AppointmentsModified(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     this.carSchedulingTableAdapter.Update(this.carsDBDataSet);
     this.carsDBDataSet.AcceptChanges();
 }
コード例 #23
0
 private void schedulerStorage1_AppointmentsDeleted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     CommitTask();
 }
コード例 #24
0
 private void AppointmentsModifiedExecute(DevExpress.XtraScheduler.PersistentObjectsEventArgs e)
 {
     carsXtraSchedulingEntities.SaveChanges();
 }