コード例 #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 InitializeDate()
        {
            if (this.officeId.Equals(0))
            {
                return;
            }

            ApplicationDateModel model = DatePersister.GetApplicationDates(this.officeId);

            DateTime date = model.Today;

            switch (this.mode)
            {
            case FrequencyType.MonthStartDate:
                date = model.MonthStartDate;
                break;

            case FrequencyType.MonthEndDate:
                date = model.MonthEndDate;
                break;

            case FrequencyType.QuarterStartDate:
                date = model.QuarterStartDate;
                break;

            case FrequencyType.QuarterEndDate:
                date = model.QuarterEndDate;
                break;

            case FrequencyType.HalfStartDate:
                date = model.FiscalHalfStartDate;
                break;

            case FrequencyType.HalfEndDate:
                date = model.FiscalHalfEndDate;
                break;

            case FrequencyType.FiscalYearStartDate:
                date = model.FiscalYearStartDate;
                break;

            case FrequencyType.FiscalYearEndDate:
                date = model.FiscalYearEndDate;
                break;
            }


            if (this.textBox != null)
            {
                this.textBox.Text = date.ToShortDateString();
            }
        }
コード例 #3
0
        public bool Reconcile(string tranCode, int year, int month, int day)
        {
            DateTime bookDate = new DateTime(year, month, day);
            string   catalog  = AppUsers.GetCurrentUserDB();
            int      officeId = AppUsers.GetCurrentLogin().View.OfficeId.ToInt();

            ApplicationDateModel model = DatePersister.GetApplicationDates(catalog, officeId);


            if (bookDate > model.FiscalYearEndDate)
            {
                throw new MixERPException(Warnings.InvalidDate);
            }

            return(Transaction.Reconcile(AppUsers.GetCurrentUserDB(), tranCode, bookDate));
        }
コード例 #4
0
        private void SuggestDateReload()
        {
            int officeId = CurrentSession.GetOfficeId();
            Collection <ApplicationDateModel> applicationDates = ApplicationStateHelper.GetApplicationDates();

            if (applicationDates != null)
            {
                ApplicationDateModel model = applicationDates.FirstOrDefault(c => c.OfficeId.Equals(officeId));
                if (model != null)
                {
                    applicationDates.Add(new ApplicationDateModel(model.OfficeId, model.Today, model.MonthStartDate, model.MonthEndDate, model.QuarterStartDate, model.QuarterEndDate, model.FiscalHalfStartDate, model.FiscalHalfEndDate, model.FiscalYearStartDate, model.FiscalYearEndDate, true));
                    applicationDates.Remove(model);

                    ApplicationStateHelper.SetApplicationDates(applicationDates);
                }
            }
        }
コード例 #5
0
        private void ForceLogOff(int officeId)
        {
            Collection <ApplicationDateModel> applicationDates = ApplicationStateHelper.GetApplicationDates();
            DateTime forcedLogOffOn = DateTime.Now.AddMinutes(2);

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

                if (model != null)
                {
                    applicationDates.Add(new ApplicationDateModel(model.OfficeId, model.Today, model.MonthStartDate, model.MonthEndDate, model.QuarterStartDate, model.QuarterEndDate, model.FiscalHalfStartDate, model.FiscalHalfEndDate, model.FiscalYearStartDate, model.FiscalYearEndDate, false, forcedLogOffOn));
                    applicationDates.Remove(model);

                    ApplicationStateHelper.SetApplicationDates(applicationDates);
                }
            }
        }
コード例 #6
0
ファイル: MixERPWebpage.cs プロジェクト: mixerp7/mixerp
        private void ForceLogOff()
        {
            int officeId = SessionHelper.GetOfficeId();
            Collection <ApplicationDateModel> applicationDates = ApplicationStateHelper.GetApplicationDates();

            if (applicationDates != null)
            {
                ApplicationDateModel model = applicationDates.FirstOrDefault(c => c.OfficeId.Equals(officeId));
                if (model != null)
                {
                    if (model.ForcedLogOffTimestamp != null)
                    {
                        if (model.ForcedLogOffTimestamp <= DateTime.Now && model.ForcedLogOffTimestamp >= SessionHelper.GetSignInTimestamp())
                        {
                            RequestLogOnPage();
                        }
                    }
                }
            }
        }
コード例 #7
0
ファイル: MixERPWebpage.cs プロジェクト: Oguima/mixerp
        private void CheckForceLogOffFlags()
        {
            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)
                {
                    if (model.ForcedLogOffTimestamp != null && !model.ForcedLogOffTimestamp.Equals(DateTime.MinValue))
                    {
                        if (model.ForcedLogOffTimestamp <= DateTime.Now && model.ForcedLogOffTimestamp >= CurrentUser.GetSignInView().LoginDateTime)
                        {
                            RequestLogOnPage();
                        }
                    }
                }
            }
        }
コード例 #8
0
        private static ApplicationDateModel GetApplicationDateModel(DataRow row)
        {
            if (row == null)
            {
                return(null);
            }

            ApplicationDateModel applicationDate = new ApplicationDateModel();

            applicationDate.OfficeId            = Conversion.TryCastInteger(row["office_id"]);
            applicationDate.Today               = Conversion.TryCastDate(row["today"]);
            applicationDate.MonthStartDate      = Conversion.TryCastDate(row["month_start_date"]);
            applicationDate.MonthEndDate        = Conversion.TryCastDate(row["month_end_date"]);
            applicationDate.QuarterStartDate    = Conversion.TryCastDate(row["quarter_start_date"]);
            applicationDate.QuarterEndDate      = Conversion.TryCastDate(row["quarter_end_date"]);
            applicationDate.FiscalHalfStartDate = Conversion.TryCastDate(row["fiscal_half_start_date"]);
            applicationDate.FiscalHalfEndDate   = Conversion.TryCastDate(row["fiscal_half_end_date"]);
            applicationDate.FiscalYearStartDate = Conversion.TryCastDate(row["fiscal_year_start_date"]);
            applicationDate.FiscalYearEndDate   = Conversion.TryCastDate(row["fiscal_year_end_date"]);

            return(applicationDate);
        }
コード例 #9
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);
                }
            }
        }
コード例 #10
0
        public static DateTime GetQuarterStartDate()
        {
            ApplicationDateModel model = GetApplicationDates();

            return((model == null) ? DateTime.Today : model.QuarterStartDate);
        }
コード例 #11
0
        public static DateTime GetMonthEndtDate()
        {
            ApplicationDateModel model = GetApplicationDates();

            return((model == null) ? DateTime.Today : model.MonthEndDate);
        }
コード例 #12
0
        public static DateTime GetFiscalYearEndDate()
        {
            ApplicationDateModel model = GetApplicationDates();

            return((model == null) ? DateTime.Today : model.FiscalYearEndDate);
        }