Exemplo n.º 1
0
 /// <summary>
 /// Create a instance of TaskStatus and add to historyChageTaskStatus
 /// </summary>
 /// <param name="status"></param>
 public void ChangeStatus(string status, User user, string description)
 {
     if (string.IsNullOrEmpty(status))
     {
         throw new ArgumentNullException();
     }
     if (!this.Status.Equals(status) && this.close == false)
     {
         if (status.Equals("Aberto"))
         {
             OpenStatus os = new OpenStatus(this);
             os.ChangeStatus();
             ChangeTaskStatus cts = new ChangeTaskStatus(status, user, description);
             this.HistoryChangeStatus.Add(cts);
         }
         else if (status.Equals("Fechado"))
         {
             CloseStatus cs = new CloseStatus(this);
             cs.ChangeStatus();
             ChangeTaskStatus cts = new ChangeTaskStatus(status, user, description);
             this.HistoryChangeStatus.Add(cts);
         }
         else if (status.Equals("Pendente"))
         {
             PendingStatus ps = new PendingStatus(this);
             ps.ChangeStatus();
             ChangeTaskStatus cts = new ChangeTaskStatus(status, user, description);
             this.HistoryChangeStatus.Add(cts);
         }
     }
 }
Exemplo n.º 2
0
        public Task()
        {
            this.HistoryChangeStatus = new List <ChangeTaskStatus>();
            this.Transfers           = new List <Transfer>();
            this.close = false;
            OpenStatus os = new OpenStatus(this);

            os.ChangeStatus();
        }