Esempio n. 1
0
        public void Evaluate(ActivityEvaluateEntity entity)
        {
            IRepository db = new RepositoryFactory().BaseRepository().BeginTrans();

            try
            {
                db.Insert <ActivityEvaluateEntity>(entity);

                var toevaluate = (from q in db.IQueryable <ToEvaluateEntity>()
                                  where q.BusinessId == entity.Activityid
                                  select q).FirstOrDefault();
                if (toevaluate != null)
                {
                    toevaluate.IsDone = true;
                    db.Update(toevaluate);

                    var message = (from q in db.IQueryable <MessageEntity>()
                                   where q.BusinessId == toevaluate.ToEvaluateId
                                   select q).FirstOrDefault();
                    if (message != null)
                    {
                        message.IsFinished = true;
                        db.Update(message);
                    }
                }

                db.Commit();
            }
            catch (Exception)
            {
                db.Rollback();
                throw;
            }
        }
        public void Evaluate(ActivityEvaluateEntity data)
        {
            IHumanDangerService ser = new HumanDangerService();

            ser.Evaluate(data);
            IHumanDangerTrainingService service = new HumanDangerTrainingService();

            service.Evaluate(data.Activityid);
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity"></param>
        public void SaveEvaluate(string keyValue, string category, ActivityEvaluateEntity entity)
        {
            var user = OperatorProvider.Provider.Current();

            try
            {
                if (user != null)  //移动端评价,user=null
                {
                    entity.DeptName = user.DeptName;
                }
                service.SaveEvaluate(keyValue, entity);
                NextTodo(category, keyValue);
                var messagebll = new MessageBLL();
                switch (category)
                {
                case "班前班后会":
                    messagebll.SendMessage("评价班前班后会", entity.ActivityEvaluateId);
                    break;

                case "危险预知训练":
                    messagebll.SendMessage("评价危险预知训练", entity.ActivityEvaluateId);
                    break;

                case "班组活动":
                    messagebll.SendMessage("评价班组活动", entity.ActivityEvaluateId);
                    break;

                case "人身风险预控":
                    messagebll.SendMessage("人身风险预控评价", entity.ActivityEvaluateId);
                    //var dangerbll = new DangerBLL();
                    //var danger = dangerbll.GetTrainingDetail(keyValue);
                    //users = userbll.GetDeptUsers(danger.GroupId);
                    //messagebll.SendMessage("评价班前班后会", null, string.Join(",", users.Select(x => x.UserId)), "工作评价", meeting.MeetingStartTime.ToString("yyyy-MM-dd"), keyValue);
                    break;

                default:
                    break;
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 4
0
        public void Evaluate(ActivityEvaluateEntity model)
        {
            IHumanDangerService service = new HumanDangerService();

            service.Evaluate(model);
        }