Example #1
0
        private bool IsChangeOld(ChangeTime ct)
        {
            // keep minimum number of changes in the queue
            if (changes.Count <= MinimalQueueSize)
            {
                return(false);
            }

            return((DateTime.Now - ct.time).TotalSeconds > ChangeIsOldAfterSeconds);
        }
Example #2
0
        private void Main_Load(object sender, EventArgs e)
        {
            lvwTasks.Activation = ItemActivation.Standard;

            myDelegate = new ChangeTime(ChangeTimeMethod);

            this.ViewData["today"] = DateTime.Now.Date;

            this.lblDate.Text = ((DateTime)this.ViewData["today"]).ToLongDateString();

            this.OnViewStateChanged("FillActivitiesCombo");
            this.OnViewStateChanged("FillGrid");
        }
Example #3
0
 private void UpdataTime()
 {
     try
     {
         if (InvokeRequired)
         {
             Delegate delegate_ = new ChangeTime(UpdataTime);
             Invoke(delegate_, new object[] { });
             Thread.Sleep(300);
         }
         else
         {
             time.Text = DateTime.Now.ToString("hh:mm");
         }
     }
     catch (Exception ex)
     {
         Dialog.ErrorBox errorBox = new ErrorBox(0x0302, this, ex);
         errorBox.Show();
     }
 }
Example #4
0
        public async Task<IHttpActionResult> ChangeTime(int id, [FromBody]ChangeTimeVM vm)
        {
            Booking booking = _bookingService.Get(id);
            if (booking == null)
            {
                return NotFound();
            }

            if (!booking.EnsoureState(BookingCommand.ChangeTime))
            {
                return BadRequest("Invalid booking state.");
            }

            ChangeTime cs = new ChangeTime(
                _sequenceService.Next(Sequence.BookingAction),
                    booking.ResourceId,
                    booking.BookingId,
                    vm == null ? null : vm.Message,
                    new TimeSlot(vm.From, vm.To),
                    DateTime.Now,
                    userId);
            ActionResponse actionResponse = await _actionBus.SendAsync<BookingActionBase, ChangeTime>(cs);
            return Ok(ActionResponseVM.ToVM(actionResponse));
        }
Example #5
0
 internal void Write(XdrDataWriter writer)
 {
     writer.Write(Size);
     ModifyTime.Write(writer);
     ChangeTime.Write(writer);
 }