Ejemplo n.º 1
0
        public async Task <IActionResult> AddTimeRecord([FromBody] AddTimeRecordViewModel addInvoiceViewModel)
        {
            var command = new AddTimeRecord(
                TimeManagementId.New,
                addInvoiceViewModel.CustomerId,
                addInvoiceViewModel.ProjectId,
                addInvoiceViewModel.TaskId,
                addInvoiceViewModel.Notes,
                addInvoiceViewModel.FromSeconds,
                addInvoiceViewModel.ToSeconds);

            await _commandBus.PublishAsync(command, CancellationToken.None);

            return(Ok());
        }
Ejemplo n.º 2
0
 public ClockPage()
 {
     InitializeComponent();
     BindingContext = new AddTimeRecordViewModel();
     Device.StartTimer(TimeSpan.FromSeconds(1), () =>
     {
         dynamicLength  = dynamicLength.Subtract(TimeSpan.FromSeconds(1));
         header.Text    = dynamicLength.ToString();
         range.EndValue = (dynamicLength.TotalSeconds / recordLength.TotalSeconds) * 360;
         if (dynamicLength.ToString().Equals("00:00:00")) // 结束了
         {
             Finish();
         }
         if (!App.IsClockPageOn)
         {
             return(false);
         }
         Console.WriteLine(DateTime.Now.ToString());
         return(true);
     });
 }