Beispiel #1
0
        public async Task <IHttpActionResult> CommentVacancy(VacancyCommentCreateModel model)
        {
            try
            {
                userId = User.Identity.GetUserId();
                Helpers.Helpers.AddBaseProperties(model.comment, "create", userId);
                Helpers.Helpers.AddBaseProperties(model.vacancyComment, "create", userId);
                Helpers.Helpers.AddBaseProperties(model.commentUser, "create", userId);
                model.commentUser.userId = userId;

                return(Ok(await VacanciesService.CommentVacancy(model)));
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
        public async Task <CommentModel> CommentVacancy(VacancyCommentCreateModel data)
        {
            try
            {
                tblComment resComment = await Task.Run(() => ManageComments.InsertComment(data.comment.ConvertTotblComment()));

                data.vacancyComment.commentId = resComment.ID;

                tblVacancyComment res = await Task.Run(() => ManageVacancyComments.CommentVacancy(data.vacancyComment.ConvertTotblVacancyComment()));

                data.vacancyComment.Id = res.ID;

                data.commentUser.commentId = resComment.ID;
                tblCommentUser resCommentUser = await Task.Run(() => ManageComments.InsertCommentUser(data.commentUser.ConvertTotblCommentUser()));

                return(resComment.ConvertToComment());
            }
            catch (Exception ex)
            {
                throw;
            }
        }