示例#1
0
        internal async Task <ResponseModel> StopRecruiterJob(RecruitersJobs source, int loginId)
        {
            ResponseModel response = new ResponseModel();

            using (IDbConnection conn = _dbConnection.Connection)
            {
                DynamicParameters param = new DynamicParameters();
                param.Add("@JobAssignmentStatusId", source.jobassignmentstatusid, DbType.Int32);
                param.Add("@JobAssignmentId", source.jobassignmentid, DbType.Int32);
                param.Add("@Submission", source.submission, DbType.Int32);
                param.Add("@NotesAdded", source.notesadded, DbType.Int32);
                param.Add("@QualificationAdded", source.qualificationadded, DbType.Int32);
                param.Add("@Comment", source.comment, DbType.String);
                param.Add("@UserId", loginId, DbType.Int32);

                var data = await conn.QueryAsync <int>(Constants.StoredProcedure.MANAGEMYJOB, param, null, null, CommandType.StoredProcedure);

                int result = 0;

                if (data.ToList().Count > 0)
                {
                    result = data.ToList()[0];
                }

                response.ResultStatus   = result;
                response.RequestType    = Constants.RequestType.POST;
                response.SuccessMessage = result == 0 ? string.Empty : "Job stopped.";
                response.ErrorMessage   = result == 0 ? "Error occurred while stopping the job.  Please try again." : string.Empty;
            }

            return(response);
        }
        public async Task <HttpResponseMessage> StopRecruiterJob(RecruitersJobs source)
        {
            int?loginId = Common.GetLoginId(Request.Headers);

            ResponseModel result = await RecruiterDal.Instance.StopRecruiterJob(source, Convert.ToInt32(loginId));

            return(SendResult(result));
        }