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); } } }
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(); } }
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)); }
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); } } }
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); } } }
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(); } } } } }
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(); } } } } }
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); }
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); } } }
public static DateTime GetQuarterStartDate() { ApplicationDateModel model = GetApplicationDates(); return((model == null) ? DateTime.Today : model.QuarterStartDate); }
public static DateTime GetMonthEndtDate() { ApplicationDateModel model = GetApplicationDates(); return((model == null) ? DateTime.Today : model.MonthEndDate); }
public static DateTime GetFiscalYearEndDate() { ApplicationDateModel model = GetApplicationDates(); return((model == null) ? DateTime.Today : model.FiscalYearEndDate); }