Beispiel #1
0
        public async Task <bool> Add(VerificationDetailModel verificationDetailModel)
        {
            VerificationDetail verificationDetail = _mapper.Map <VerificationDetail>(verificationDetailModel);

            _context.VerificationDetails.Add(verificationDetail);
            int count = await _context.SaveChangesAsync();

            return(count > 0);
        }
Beispiel #2
0
        public async Task <bool> Add(LcdaModel lcdaModel)
        {
            Lcda lcda = _mapper.Map <Lcda>(lcdaModel);

            _context.Lcdas.Add(lcda);
            int count = await _context.SaveChangesAsync();

            return(count > 0);
        }
Beispiel #3
0
        public async Task <bool> Add(UserModel userModel)
        {
            User user = _mapper.Map <User>(userModel);

            _remsDbContext.Users.Add(user);
            int count = await _remsDbContext.SaveChangesAsync();

            return(count > 0);
        }
Beispiel #4
0
        public async Task <ResponseModel> AddAsync(WardModel wardModel)
        {
            Ward ward = _mapper.Map <Ward>(wardModel);

            _context.Wards.Add(ward);
            int count = await _context.SaveChangesAsync();

            if (count > 0)
            {
                return(new ResponseModel()
                {
                    code = ResponseCode.SUCCESSFULL,
                    description = $"{wardModel.WardName} has been updated successfully"
                });
            }
            return(new ResponseModel()
            {
                code = ResponseCode.FAIL,
                description = "Update was not successful. Please try again or contact an administrator, if error persist"
            });
        }