예제 #1
0
        public Result CreateApplyOfJob(ApplyJobDto applyJobDto, string account)
        {
            Worker     worker   = _ctx.Worker.SingleOrDefault(w => w.Account.Equals(account));
            int        informId = 0;
            ApplyFoJob apply    = new ApplyFoJob()
            {
                Content     = applyJobDto.Content,
                Type        = applyJobDto.Type,
                CreateTime  = DateTime.Now.ToFileTime(),
                WorkerId    = worker.Id,
                DeparmentId = worker.DepartmentId,
                CompanyId   = worker.CompanyId,
            };

            _ctx.ApplyFoJob.Add(apply);
            _ctx.SaveChanges();
            informId = AddInform(apply.Id, apply.WorkerId, "Job");
            Result result = new Result()
            {
                IsSuccess = true,
                Message   = "添加成功!",
                Id        = informId
            };

            return(result);
        }
예제 #2
0
        public async Task <Result> CreateApplyOfJob([FromBody] ApplyJobDto applyJobDto)
        {
            var    context = HttpContext;
            string account = await _jwtUtil.GetMessageByToken(context);

            return(_approvalAppService.CreateApplyOfJob(applyJobDto, account));
        }
예제 #3
0
        public async Task <Result> CreateApplyOfJob([FromBody] ApplyJobDto applyJobDto)
        {
            var    context = HttpContext;
            string account = await _jwtUtil.GetMessageByToken(context);

            Result result = _approvalAppService.CreateApplyOfJob(applyJobDto, account);

            if (result.Id != 0)
            {
                await _signalrHubs.Send(result.Id.ToString(), "您有新的消息");
            }
            return(result);
        }
 public Result CreateApplyOfJob(ApplyJobDto applyJobDto, string account)
 {
     return(_approvalManager.CreateApplyOfJob(applyJobDto, account));
 }