public void UpdateListMeasTask()
        {
            ClassConvertTasks ts   = new ClassConvertTasks();
            ClassesDBGetTasks cl   = new ClassesDBGetTasks();
            List <MeasTask>   mts_ = ts.ConvertTo_MEAS_TASKObjects(cl.ReadlAllSTasksFromDB()).ToList();

            foreach (MeasTask FND in mts_.ToArray())
            {
                // Удаляем данные об объекте с глобального списка
                if (GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == FND.Id.Value) == null)
                {
                    GlobalInit.LIST_MEAS_TASK.Add(FND);
                }
                else
                {
                    //lock (GlobalInit.LIST_MEAS_TASK)
                    if ((FND.Status != null) && (FND.Status != "N"))
                    {
                        MeasTask fnd = GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == FND.Id.Value);
                        if (fnd != null)
                        {
                            GlobalInit.LIST_MEAS_TASK.ReplaceAll <MeasTask>(fnd, FND);
                        }
                        else
                        {
                            GlobalInit.LIST_MEAS_TASK.Add(FND);
                        }
                    }
                }
            }
            ts.Dispose();
            cl.Dispose();
        }
        /// <summary>
        /// Добавление в очередь новых тасков
        /// </summary>
        /// <param name="s_out"></param>
        /// <returns>количество новых объектов, добавленных в глобальный список</returns>
        public int Create_New_Meas_Task(MeasTask s_out, string ActionType)
        {
            ClassesDBGetTasks cl = new ClassesDBGetTasks();
            ClassConvertTasks ts = new ClassConvertTasks();
            int NewIdMeasTask    = -1;

            try
            {
                if (s_out != null)
                {
                    //lock (GlobalInit.LIST_MEAS_TASK)
                    //UpdateListMeasTask();
                    MeasTask Data_ = s_out;
                    // создаём объект список подзадач типа MEAS_SUB_TASK и записываем в объект Data_
                    Data_.CreateAllSubTasks();
                    CoreICSM.Logs.CLogs.WriteInfo(ELogsWhat.Unknown, "[CreateAllSubTasks] success...");
                    // конвертируем объекты тасков с БД в список List<MEAS_TASK>
                    //List<MeasTask> mts_ = ts.ConvertTo_MEAS_TASKObjects(cl.ReadlAllSTasksFromDB()).ToList();
                    List <MeasTask> mts_ = GlobalInit.LIST_MEAS_TASK;
                    if (mts_.Find(r => r.Id.Value == Data_.Id.Value) == null)
                    {
                        if (((GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value) == null)))
                        {
                            Data_.UpdateStatus(ActionType);
                            CoreICSM.Logs.CLogs.WriteInfo(ELogsWhat.Unknown, "Success UpdateStatus !!!...");
                            NewIdMeasTask = cl.SaveTaskToDB(Data_);
                            CoreICSM.Logs.CLogs.WriteInfo(ELogsWhat.Unknown, "Success create new TASK !!!...");
                            MeasTask fnd = GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value);
                            if (fnd != null)
                            {
                                GlobalInit.LIST_MEAS_TASK.ReplaceAll <MeasTask>(fnd, Data_);
                            }
                            else
                            {
                                GlobalInit.LIST_MEAS_TASK.Add(Data_);
                            }
                        }
                        else
                        {
                            if (GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value) != null)
                            {
                                Data_ = GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value);
                                Data_.UpdateStatus(ActionType);
                                //cl.SaveStatusTaskToDB(Data_);
                                MeasTask fnd = GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value);
                                if (fnd != null)
                                {
                                    GlobalInit.LIST_MEAS_TASK.ReplaceAll <MeasTask>(fnd, Data_);
                                }
                                else
                                {
                                    GlobalInit.LIST_MEAS_TASK.Add(Data_);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value) != null)
                        {
                            Data_ = GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value);
                            Data_.UpdateStatus();
                            //cl.SaveStatusTaskToDB(Data_);
                            MeasTask fnd = GlobalInit.LIST_MEAS_TASK.Find(j => j.Id.Value == Data_.Id.Value);
                            if (fnd != null)
                            {
                                GlobalInit.LIST_MEAS_TASK.ReplaceAll <MeasTask>(fnd, Data_);
                            }
                            else
                            {
                                GlobalInit.LIST_MEAS_TASK.Add(Data_);
                            }
                        }
                    }
                }
                CoreICSM.Logs.CLogs.WriteInfo(ELogsWhat.Unknown, "[Create_New_Meas_Task] success...");
            }
            catch (Exception er) {
                CoreICSM.Logs.CLogs.WriteError(ELogsWhat.Unknown, "[Create_New_Meas_Task]: " + er.Message);
            }
            cl.Dispose();
            ts.Dispose();
            return(NewIdMeasTask);
        }