示例#1
0
        private void ForceLogOff(int officeId)
        {
            Collection <ApplicationDateModel> applicationDates = CacheFactory.GetApplicationDates();
            DateTime forcedLogOffOn = DateTime.Now.AddMinutes(2);

            if (applicationDates != null)
            {
                ApplicationDateModel model = applicationDates.FirstOrDefault(c => c.OfficeId.Equals(officeId));

                if (model != null)
                {
                    ApplicationDateModel item = model.Clone() as ApplicationDateModel;
                    if (item != null)
                    {
                        item.ForcedLogOffTimestamp = forcedLogOffOn;
                        item.NewDayStarted         = false;

                        applicationDates.Add(item);
                        applicationDates.Remove(model);
                    }


                    CacheFactory.SetApplicationDates(applicationDates);
                }
            }
        }
示例#2
0
        private void SuggestDateReload()
        {
            int officeId = CurrentUser.GetSignInView().OfficeId.ToInt();
            Collection <ApplicationDateModel> applicationDates = CacheFactory.GetApplicationDates();

            if (applicationDates != null)
            {
                ApplicationDateModel model = applicationDates.FirstOrDefault(c => c.OfficeId.Equals(officeId));
                if (model != null)
                {
                    ApplicationDateModel item = model.Clone() as ApplicationDateModel;
                    if (item != null)
                    {
                        item.NewDayStarted = true;

                        applicationDates.Add(item);
                        applicationDates.Remove(model);
                    }


                    CacheFactory.SetApplicationDates(applicationDates);
                }
            }
        }