示例#1
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();
            }
        }
示例#2
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));
        }