public SetCustomCountdownPage() { this.InitializeComponent(); if (Settings.Current.ShowSeconds) { VisualStateManager.GoToState(this, "ShowSeconds", true); } // initialize user times plus a current countdown time currentCountdownTime = new CountdownTime(); userTimes = new UserTimes(); SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; }
public StartPage() { this.InitializeComponent(); SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; InitializeLicense(); // initialize user times plus 4 deep int array for saved time data userTimes = new UserTimes(); previousTimeVals = new int[4]; TryGetSavedPreviousTimes(); PopulatePreviousButtons(); FadeInPageContent.Begin(); }
private void ReadFile() { try { var fileDialog = new System.Windows.Forms.OpenFileDialog(); var result = fileDialog.ShowDialog(); switch (result) { case System.Windows.Forms.DialogResult.OK: if (fileDialog.FileName.Contains(".csv")) { if (int.TryParse(Day.Text, out var day) && int.TryParse(Hours.Text, out var hours)) { var timeSet = ReadCSVFile.GetTimesPerDay(fileDialog.OpenFile(), day - 1, hours - 1); var times = new List <TimeObject>(); var project = (Project)Projects.SelectedItem; var module = (Projectmodule)Modules.SelectedItem; var worktype = (Projectworktype)WorkTypes.SelectedItem; times.AddRange(timeSet.Select(time => new TimeObject { personid = _primaryInformation != null ? _primaryInformation.Me.personid.ToString() : _userData.PersonId, time = Math.Round(time.Value, 2).ToString(CultureInfo.InvariantCulture), billable = "t", date = DateTime.Parse(time.Key).ToString("yyyy-MM-dd"), projectid = int.Parse(project.id).ToString(), moduleid = int.Parse(module.moduleid).ToString(), worktypeid = int.Parse(worktype.worktypeid).ToString() })); _userTimes = new UserTimes(_timeTaskService, times); Submit.IsEnabled = true; } } break; } } catch (Exception e) { MessageBox.Show(e.Message); } }