コード例 #1
0
 public static async Task SubmitTimesheetEntry(TimesheetEntry timesheet)
 {
     await Task.Delay(2000); // NOTE: just to simulate a HTTP request over the wire
     if (DateTime.Now.Second < 10)
         throw new Exception("Some exception");
     return;
 }
コード例 #2
0
 private static TimesheetEntry BindTimesheetEntry(TextView dateText, TextView customerText, TextView projectText, Spinner hoursInput, EditText commentInput, Switch sickLeaveInput)
 {
     var timesheet = new TimesheetEntry()
     {
         Date = DateTime.ParseExact(dateText.Text, "dd MMM yyyy", CultureInfo.InvariantCulture),
         Customer = customerText.Text,
         Project = projectText.Text,
         Hours = Convert.ToDecimal(hoursInput.SelectedItem.ToString()),
         Comment = commentInput.Text,
         SickLeave = sickLeaveInput.Checked
     };
     return timesheet;
 }