Exemple #1
0
        public bool Read()
        {
            try
            {
                Data.PROCESSED_TASK processedTask = Connection.ProcessSA_DB.PROCESSED_TASK.First(pt => pt.ID == Id);
                Id              = (int)processedTask.ID;
                Commentary      = processedTask.COMMENTARY;
                AssignationDate = processedTask.ASSIGNATIONDATE;
                StartDate       = processedTask.STARTDATE;
                EndDate         = processedTask.ENDDATE;
                IdTaskStatus    = (int)processedTask.ID_TASKSTATUS;
                TaskAssignment  = new TaskAssignment((int)processedTask.ID_TASK_ASSIGNMENT);

                if (processedTask.ID_SCHEDULED_LOOPTASK != null)
                {
                    LoopTaskSchedule = new LoopTaskSchedule((int)processedTask.ID_SCHEDULED_LOOPTASK);
                }
                else
                {
                    LoopTaskSchedule = null;
                }
                return(true);
            }
            catch (Exception e)
            {
                log.Error("Ha ocurrido un error durante la lectura de ProcessedTask con Id: " + Id, e);
                return(false);
            }
        }
Exemple #2
0
 public bool ReadById()
 {
     try
     {
         Data.LOOP_TASK loopTask = Connection.ProcessSA_DB.LOOP_TASK.First(lt => lt.ID == Id);
         Id             = (int)loopTask.ID;
         TaskAssignment = new TaskAssignment((int)loopTask.ID_TASK_ASSIGNMENT);
         StartTime      = loopTask.STARTTIME;
         EndTime        = loopTask.ENDTIME;
         Isactive       = StaticHelper.ShortToBool(loopTask.ISACTIVE);
         return(true);
     }
     catch (Exception e)
     {
         log.Error("Ha ocurrido un error durante la lectura de LoopTask con Id: " + Id, e);
         return(false);
     }
 }