Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public static void DoSynchData()
        {
            //SynchronizationService.SynchDataTime();
            //var thisUnit = CommonService.GetIsThisUnit();
            //if (thisUnit != null)
            //{
            //    if (thisUnit.UnitId == Const.UnitId_CWCEC) ////五环单位执行 人员 培训考试 与博晟同步数据
            //    {
            //        var sysSet5 = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_ChangeData).FirstOrDefault();
            //        if (sysSet5 != null && sysSet5.ConstValue == "1")
            //        {
            //            GetDataService.AddData();
            //        }
            //    }
            //    else if (thisUnit.UnitId == Const.UnitId_SEDIN) ////赛鼎
            //    {
            //        GetDataService.CreateTrainingTaskItemByTaskId(null);
            //        GetDataService.UpdateTestPlanStates();
            //        GetDataService.CorrectingPersonInOutNumber(null);
            //        GetDataService.CreateQRCode();
            //        ServerTestPlanService.EndTestPlan(null);
            //    }
            //}

            GetDataService.CreateTrainingTaskItemByTaskId(null);
            GetDataService.UpdateTestPlanStates();
            GetDataService.CorrectingPersonInOutNumber(null);
            GetDataService.CreateQRCode();
            ServerTestPlanService.EndTestPlan(null);
            ////推送订阅消息
            GetDataService.SendSubscribeMessage();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据TaskId获取培训任务列表
        /// </summary>
        /// <param name="taskId"></param>
        /// <returns></returns>
        public static List <Model.TrainingTaskItemItem> getTrainingTaskItemListByTaskId(string taskId)
        {
            ////生成培训任务下培训明细
            GetDataService.CreateTrainingTaskItemByTaskId(taskId);

            var getDataLists = (from x in Funs.DB.Training_TaskItem
                                where x.TaskId == taskId
                                orderby x.TrainingItemCode
                                select new Model.TrainingTaskItemItem
            {
                TaskItemId = x.TaskItemId,
                TaskId = x.TaskId,
                PlanId = x.PlanId,
                PersonId = x.PersonId,
                TrainingItemCode = x.TrainingItemCode,
                TrainingItemName = x.TrainingItemName,
                AttachUrl = x.AttachUrl.Replace('\\', '/'),
            }).ToList();

            return(getDataLists);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据PlanId、PersonId将人员加入培训任务
        /// </summary>
        /// <param name="planId">培训计划ID</param>
        /// <param name="personId">人员ID</param>
        /// <returns></returns>
        public static void getTrainingTaskByPlanIdPersonId(string planId, string personId)
        {
            using (Model.SUBHSSEDB db = new Model.SUBHSSEDB(Funs.ConnString))
            {
                var plan = db.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
                Model.Training_Task newTask = new Model.Training_Task
                {
                    TaskId   = SQLHelper.GetNewID(),
                    PlanId   = planId,
                    UserId   = personId,
                    TaskDate = DateTime.Now,
                    States   = "0",
                };
                if (plan != null)
                {
                    newTask.ProjectId = plan.ProjectId;
                    db.Training_Task.InsertOnSubmit(newTask);
                    db.SubmitChanges();

                    ////生成培训任务下培训明细
                    GetDataService.CreateTrainingTaskItemByTaskId(newTask.TaskId);
                }
            }
        }