Esempio n. 1
0
        public void SetGregorValues()
        {
            try
            {
                var gregorDayFrom = ReportUtility.GetGregorCalendar(SelectedEthioYear.Value, SelectedEthioMonth.Value,
                                                                    SelectedEthioDay.Value);
                SelectedDate = gregorDayFrom;

                int dayf   = Convert.ToInt32(gregorDayFrom.Day),
                    monthf = Convert.ToInt32(gregorDayFrom.Month),
                    yearf  = Convert.ToInt32(gregorDayFrom.Year);
                SelectedGregorDay   = GregorDays[dayf - 1];
                SelectedGregorMonth = GregorMonths[monthf - 1];
                SelectedGregorYear  = GregorYears[yearf - 1900];
            }
            catch
            {
                //MessageBox.Show("Can't convert, may be out side of the scope!");
            }
        }
Esempio n. 2
0
        public ExpensesViewModel()
        {
            FillPeriodCombo();
            CheckRoles();
            //SelectedPeriod = FilterPeriods.FirstOrDefault();

            var currentMonth = Convert.ToInt32(ReportUtility.GetEthCalendar(DateTime.Now, false).Substring(2, 2));
            var currentYear  = Convert.ToInt32(ReportUtility.GetEthCalendar(DateTime.Now, false).Substring(4, 4));

            FilterStartDate = ReportUtility.GetGregorCalendar(currentYear, currentMonth, 1);
            FilterEndDate   = ReportUtility.GetGregorCalendar(currentYear, currentMonth, 30);

            if (currentMonth == 13)
            {
                FilterEndDate = ReportUtility.GetGregorCalendar(currentYear, currentMonth, 5);
            }

            FillPaymentTypesCombo();
            SelectedPaymentType = PaymentTypesFilter.FirstOrDefault();

            GetWarehouses();
            Load();
        }