Ejemplo n.º 1
0
 public CInitiative(InitiativeAction pAction, uint pTimeDelay, bool pRepeatMode, InitiativeAction pOnSuccessAction, InitiativeAction pOnFailureAction)
 {
     action          = pAction;
     timer           = new Timer(pTimeDelay);
     timer.AutoReset = pRepeatMode;
     timer.Elapsed  += _OnTimerElapsed;
 }
Ejemplo n.º 2
0
 public void DeleteInitiativeAction(InitiativeAction initiativeAction)
 {
     if (initiativeAction == null)
     {
         throw new ArgumentNullException(nameof(initiativeAction));
     }
     _context.InitiativeAction.Remove(initiativeAction);
 }
Ejemplo n.º 3
0
 public void CreateInitiativeAction(InitiativeAction initiativeAction)
 {
     if (initiativeAction == null)
     {
         throw new ArgumentNullException(nameof(initiativeAction));
     }
     _context.InitiativeAction.Add(initiativeAction);
 }
Ejemplo n.º 4
0
 public CInitiative(InitiativeAction pAction, double pTimeDelay, bool pRepeatMode = false)
 {
     action          = pAction;
     timer           = new Timer(pTimeDelay);
     timer.AutoReset = pRepeatMode;
     timer.Elapsed  += _OnTimerElapsed;
     timer.Start();
 }
Ejemplo n.º 5
0
 public CInitiative(InitiativeAction pAction, double pTimeDelay, bool pRepeatMode = false, bool pStartRightNow = true, string pTitle = "", string pDescription = "")
 {
     action          = pAction;
     timer           = new Timer(pTimeDelay);
     timer.AutoReset = pRepeatMode;
     timer.Elapsed  += _OnTimerElapsed;
     _title          = pTitle;
     _description    = pDescription;
     if (pStartRightNow)
     {
         timer.Start();
     }
 }
        public async Task <bool> UpdateActionAsync(InitiativeAction initiativeAction)
        {
            var actionInDb = await _context.InitiativeActions.FindAsync(initiativeAction.Id);

            if (actionInDb == null)
            {
                return(false);
            }

            actionInDb.Progress = initiativeAction.Progress;

            _context.Entry(actionInDb).State = EntityState.Modified;

            return(await _context.SaveChangesAsync() > 0);
        }
        public async Task <bool> UpdateInitiativeAction(InitiativeAction initiativeAction)
        {
            var record = await GetInitiativeActionById(initiativeAction.InitiativeActionId);

            record.Progress     = initiativeAction.Progress;
            record.Name         = initiativeAction.Name;
            record.Description  = initiativeAction.Description;
            record.InitiativeId = initiativeAction.InitiativeId;
            record.Deadline     = initiativeAction.Deadline;
            record.CreatedBy    = initiativeAction.CreatedBy;
            record.CreatedDate  = initiativeAction.CreatedDate;
            record.UpdatedDate  = initiativeAction.UpdatedDate;
            InitiativeContext.InitiativeActions.Update(record);
            return(await InitiativeContext.SaveChangesAsync() > 0);
        }
Ejemplo n.º 8
0
 public void UpdateInitiativeAction(InitiativeAction initiativeAction)
 {
     //Nothing
 }
        public async Task <bool> CreateActionAsync(InitiativeAction initiativeAction)
        {
            await _context.InitiativeActions.AddAsync(initiativeAction);

            return(await _context.SaveChangesAsync() > 0);
        }
Ejemplo n.º 10
0
 public abstract void DeleteInitiative(InitiativeAction pAction);
        public async Task <IActionResult> UpdateInitiativeAction(InitiativeAction initiativeAction)
        {
            var response = await InitiativeActionRepository.UpdateInitiativeAction(initiativeAction);

            return(Ok(response));
        }
        public async Task <IActionResult> CreateInitiativeAction(InitiativeAction data)
        {
            var response = await InitiativeActionRepository.CreateInitiativeAction(data);

            return(Ok(response));
        }