Пример #1
0
 public static void AddNavigateForwardAction(IDateTimeNavigationService navigate)
 {
     if (UndoService.CandAddAction)
     {
         UndoService.AddAction(new NavigateForwardAction(navigate));
     }
 }
        protected void Page_Init(object sender, EventArgs e)
        {
            IDateTimeNavigationService service = ASPxScheduler1.GetService(typeof(IDateTimeNavigationService)) as IDateTimeNavigationService;

            ASPxScheduler1.RemoveService(typeof(IDateTimeNavigationService));
            ASPxScheduler1.AddService(typeof(IDateTimeNavigationService), new MyDateTimeNavigationService(ASPxScheduler1, service));
        }
Пример #3
0
 public static void AddGotoDateAction(IDateTimeNavigationService navigate, DateTime newValue, DateTime oldValue, SchedulerViewType newViewType, SchedulerViewType oldViewType)
 {
     if (UndoService.CandAddAction)
     {
         UndoService.AddAction(new GotoDateAction(navigate, newValue, oldValue, newViewType, oldViewType));
     }
 }
 public MyDateTimeNavigationService(ASPxScheduler control, IDateTimeNavigationService baseService)
 {
     if (control == null)
     {
         Exceptions.ThrowArgumentNullException("control");
     }
     this.control_Renamed     = control;
     this.baseService_Renamed = baseService;
 }
Пример #5
0
        protected override void ExecuteCore()
        {
            IDateTimeNavigationService service = (IDateTimeNavigationService)Control.GetService(typeof(IDateTimeNavigationService));

            if (service != null)
            {
                service.GoToDate(NewDate);
            }
        }
        private void btnBack_Click(object sender, EventArgs e)
        {
            IDateTimeNavigationService svc = schedulerControl1.GetService <IDateTimeNavigationService>();

            if (svc != null)
            {
                svc.NavigateBackward();
            }
            // You can also use the following code to navigate backward.
            //schedulerControl1.Services.DateTimeNavigation.NavigateBackward();
        }
 private void btnForth_Click(object sender, EventArgs e)
 {
     #region #IDateTimeNavigationService
     IDateTimeNavigationService svc = schedulerControl1.GetService <IDateTimeNavigationService>();
     if (svc != null)
     {
         svc.NavigateForward();
     }
     // You can also use the following code to navigate forward.
     //schedulerControl1.Services.DateTimeNavigation.NavigateForward();
     #endregion #IDateTimeNavigationService
 }
Пример #8
0
 public GotoDateAction(
     IDateTimeNavigationService navigate
     , DateTime newValue
     , DateTime oldValue
     , SchedulerViewType newViewType
     , SchedulerViewType oldViewType)
 {
     Name             = "Goto date";
     this.navigate    = navigate;
     this.newValue    = newValue;
     this.oldValue    = oldValue;
     this.newViewType = newViewType;
     this.oldViewType = oldViewType;
 }
Пример #9
0
 private void btnToday_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         IDateTimeNavigationService service = Calendar.GetService(typeof(IDateTimeNavigationService)) as IDateTimeNavigationService;
         if (service != null)
         {
             service.GoToToday();
         }
     }
     catch (Exception ex)
     {
         if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
         {
             throw ex;
         }
     }
 }
Пример #10
0
 protected override void OnPreviousRecord()
 {
     try
     {
         base.OnPreviousRecord();
         IDateTimeNavigationService service = Calendar.GetService(typeof(IDateTimeNavigationService)) as IDateTimeNavigationService;
         if (service != null)
         {
             service.NavigateBackward();
         }
     }
     catch (Exception ex)
     {
         if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
         {
             throw ex;
         }
     }
 }
Пример #11
0
        protected override void OnStart()
        {
            try
            {
                base.OnStart();
                defaultSiteId = BL.ApplicationDataContext.Instance.LoggedInUser.DefaultSiteId;
                AllowArchive  = false;
                if (DataContext.EntityHumanResourcesContext.HRS_Employee.Any(n => n.PersonId == BL.ApplicationDataContext.Instance.LoggedInUser.PersonId))
                {
                    var currentRole = DataContext.EntityHumanResourcesContext.HRS_Employee.FirstOrDefault(n => n.PersonId == BL.ApplicationDataContext.Instance.LoggedInUser.PersonId).RoleId;
                    var roleAccess  = DataContext.EntityHumanResourcesContext.HRS_Role.FirstOrDefault(n => n.Id == currentRole);

                    ServerModeSourceEmployee.QueryableSource = DataContext.ReadonlyContext.VW_Employee.Where(n => n.Id == BL.ApplicationDataContext.Instance.LoggedInUser.PersonId);

                    btnNewAppointment.Visibility          = roleAccess.Appointment.Value ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never;
                    btnNewPurchasesAppointment.Visibility = roleAccess.PurchaseAppointment.Value ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never;
                    btnNewSalesAppointment.Visibility     = roleAccess.SaleAppointment.Value ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never;
                    btnNewWorkshopAppointment.Visibility  = roleAccess.WorkshopAppointment.Value ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never;
                }
                //var asd = DataContext.ReadonlyContext.VW_Employee.Where(n => rloids.Contains(n.RoleId)).ToList();
                //select by SiteId
                List <long?> companies       = DataContext.EntityOrganisationContext.ORG_Company.Where(n => n.SiteId == defaultSiteId).Select(n => n.EntityId).ToList().ConvertAll(a => (long?)a);
                List <long?> companyEntities = DataContext.EntityOrganisationContext.ORG_Entity.Where(n => companies.Contains(n.Id)).Select(n => n.EntityId).ToList().ConvertAll(a => (long?)a);
                calendar = DataContext.EntityCalendarContext.CAL_Calendar.Where(n => companyEntities.Contains(n.EntityId)).ToList();
                BindingSource.DataSource = calendar;

                IDateTimeNavigationService service = Calendar.GetService(typeof(IDateTimeNavigationService)) as IDateTimeNavigationService;
                if (service != null)
                {
                    service.GoToToday();
                }

                Calendar.DayView.TopRowTime      = new TimeSpan(DateTime.Now.TimeOfDay.Hours, 00, 00);
                Calendar.WorkWeekView.TopRowTime = new TimeSpan(DateTime.Now.TimeOfDay.Hours, 00, 00);
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
            }
        }
Пример #12
0
 public NavigateDecorator(SchedulerControl control, IDateTimeNavigationService navigate)
 {
     _innerNavigate = navigate;
     _control       = control;
 }
Пример #13
0
 public NavigateForwardAction(IDateTimeNavigationService navigate)
 {
     Name          = "Forward";
     this.navigate = navigate;
 }