Example #1
0
        private void InsertRow()
        {
            var item = new MonthText();

            Riddles = Riddles == null ? new ObservableCollection <MonthText>() : Riddles;
            Riddles.Add(item);
        }
Example #2
0
        private void InsertRow()
        {
            var item = new MonthText();

            Citations = Citations == null ? new ObservableCollection <MonthText>() : Citations;
            Citations.Add(item);
        }
        protected override void Execute(CodeActivityContext executionContext)
        {
            var      dateString = DateString.Get <string>(executionContext);
            var      dateFormat = DateFormat.Get <string>(executionContext);
            DateTime date;

            if (!String.IsNullOrWhiteSpace(dateString))
            {
                var provider = CultureInfo.InvariantCulture;

                if (!DateTime.TryParseExact(dateString, dateFormat, provider, DateTimeStyles.None, out date))
                {
                    date = Date.Get <DateTime>(executionContext);
                }
            }
            else
            {
                date = Date.Get <DateTime>(executionContext);
            }

            bool am;

            var hour = date.Hour;

            Year.Set(executionContext, date.Year);
            YearText.Set(executionContext, date.Year.ToString());
            Month.Set(executionContext, date.Month);
            Day.Set(executionContext, date.Day);
            Hour24.Set(executionContext, date.Hour);

            var cultureInfo = GetCultureInfo(executionContext, LanguageCode.Get <int>(executionContext));

            MonthText.Set(executionContext, date.ToString("MMMM", cultureInfo.DateTimeFormat));
            DayOfWeekString.Set(executionContext, date.ToString("dddd", cultureInfo.DateTimeFormat));


            if (date.Hour >= 12)
            {
                am   = false;
                hour = date.Hour - 12;
            }
            else
            {
                am = true;
            }

            Hour.Set(executionContext, hour);
            IsAM.Set(executionContext, am);
            IsPM.Set(executionContext, !am);
            Minute.Set(executionContext, date.Minute);

            DayOfWeek.Set(executionContext, (int)date.DayOfWeek);
            DayOfYear.Set(executionContext, date.DayOfYear);
            Week.Set(executionContext, GetWeek(date));
        }
        private void InitViews()
        {
            if (LeftArrow != null)
            {
                LeftArrow.Click -= LeftArrow_Click;
                LeftArrow.Click += LeftArrow_Click;
                LeftArrow?.SetImageFromResource(DrawableConstants.LeftEventArrow);
            }

            if (RightArrow != null)
            {
                RightArrow.Click -= RightArrow_Click;
                RightArrow.Click += RightArrow_Click;
                RightArrow?.SetImageFromResource(DrawableConstants.RightEventArrow);
            }

            if (MonthText != null)
            {
                MonthText.Text = EventManager.Instance.IsDay == EventType.Day ? EventManager.Instance.CurrentDateTime.ToString("MMMM") : FormatDateTime(EventManager.Instance.CurrentDateTime);

                MonthText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size28);
                MonthText.SetTextColor(ColorConstants.WhiteColor);
            }

            if (IntervalEventsDate == null)
            {
                return;
            }
#if __ANDROID__
            IntervalEventsDate.Text = EventManager.Instance.IsDay == EventType.Day ? "today events".ToUpperInvariant() : "month events".ToUpperInvariant();
#else
            if (EventManager.Instance.IsDay == EventType.Day)
            {
                IntervalEventsDate.Text = "   today events   ".ToUpperInvariant();
            }
            else
            {
                IntervalEventsDate.Text = "   month events   ".ToUpperInvariant();
            }
#endif

            IntervalEventsDate?.SetBackgroundColor(ColorConstants.TransparentColor, 4, ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent70), 1);
            IntervalEventsDate.SetTextColor(ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent70));
            IntervalEventsDate.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size12);
            IntervalEventsDate.SetSelectedColor(ColorConstants.WhiteColor);

            IntervalEventsDate.Click -= IntervalMonth_Click;
            IntervalEventsDate.Click += IntervalMonth_Click;
        }
Example #5
0
        private void UpdateTexts()
        {
            YearText.Text   = SelectedTime.Year.ToString("0000");
            MonthText.Text  = SelectedTime.Month.ToString("00");
            DayText.Text    = SelectedTime.Day.ToString("00");
            HourText.Text   = SelectedTime.Hour.ToString("00");
            MinuteText.Text = SelectedTime.Minute.ToString("00");
            SecondText.Text = SelectedTime.Second.ToString("00");

            YearText.SelectAll();
            MonthText.SelectAll();
            DayText.SelectAll();
            HourText.SelectAll();
            MinuteText.SelectAll();
            SecondText.SelectAll();
        }
        private void CalculateMonthlySales_Click(object sender, RoutedEventArgs e)
        {
            string Month = MonthText.GetLineText(0);
            string Year  = YearText.GetLineText(0);

            StatsCalc SC = new StatsCalc(cn);

            try
            {
                MonthlySalesText.Text = SC.MonthlySales(Month, Year);
            }
            catch (OleDbException ex)
            {
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
            }
        }