Пример #1
0
 public DtoFullInstance GetFullInstanceById(int id)
 {
     return(SimpleCommand.ExecuteQuery <DtoFullInstance>(_connStr,
                                                         $@"select id,taskid,starttime,duration,state,trynumber,data,viewdata
         from Instance i join instancedata idat on id=instanceid where id={id}")
            .ToList().First());
 }
Пример #2
0
 public List <DtoFullInstance> GetFullInstancesByTaskId(int taskId)
 {
     return(SimpleCommand.ExecuteQuery <DtoFullInstance>(_connStr,
                                                         $@"select id,taskid,starttime,duration,state,trynumber,data,viewdata
         from Instance i join instancedata idat on id=instanceid where taskid={taskId} order by id")
            .ToList());
 }
Пример #3
0
        public List <T> GetAllInstances <T>() where T : new()
        {
            List <T> retList = new List <T>();
            var      type    = typeof(T);

            switch (true)
            {
            case bool _ when type == typeof(DtoRecepientGroup):
                var list = SimpleCommand.ExecuteQuery <T>(_connStr,
                                                          "select * from RecepientGroup");
                foreach (dynamic instance in list)
                {
                    retList.Add((T)instance.Value);
                }
                break;
            }

            return(retList);
        }
Пример #4
0
 public List <DtoInstance> GetInstancesByTaskId(int taskId)
 {
     return(SimpleCommand.ExecuteQuery <DtoInstance>(_connStr,
                                                     $"select * from Instance where taskid={taskId}")
            .ToList());
 }
Пример #5
0
 public List <DtoInstance> GetAllInstances()
 {
     return(SimpleCommand.ExecuteQuery <DtoInstance>(_connStr,
                                                     "select * from Instance")
            .ToList());
 }
Пример #6
0
 public List <DtoTask> GetAllTasks()
 {
     return(SimpleCommand.ExecuteQuery <DtoTask>(_connStr, "select * from task").ToList());
 }
Пример #7
0
 public List <DtoTelegramChannel> GetAllTelegramChannels()
 {
     return(SimpleCommand.ExecuteQuery <DtoTelegramChannel>(_connStr,
                                                            "select * from TelegramChannel")
            .ToList());
 }
Пример #8
0
 public List <DtoReport> GetAllReports()
 {
     return(SimpleCommand.ExecuteQuery <DtoReport>(_connStr,
                                                   "select * from Report")
            .ToList());
 }
Пример #9
0
 public List <DtoSchedule> GetAllSchedules()
 {
     return(SimpleCommand.ExecuteQuery <DtoSchedule>(_connStr,
                                                     "select * from Schedule")
            .ToList());
 }
Пример #10
0
        } //ctor

        public List <DtoRecepientGroup> GetAllRecepientGroups()
        {
            return(SimpleCommand.ExecuteQuery <DtoRecepientGroup>(_connStr,
                                                                  "select * from RecepientGroup")
                   .ToList());
        }