public bool DeleteByUserId(long userId)
        {
            _unitOfWork.TokenRepository.Delete(x => x.UserID == userId);
            _unitOfWork.Save();

            var isNotDeleted = _unitOfWork.TokenRepository.GetMany(x => x.UserID == userId).Any();

            return(!isNotDeleted);
        }
Beispiel #2
0
        public AccountModel SavePersonalDetails(UserRegistartionPersonalDetailsModel model)
        {
            AccountModel responseModel = new AccountModel();

            responseModel.data = Guid.NewGuid().ToString() + "," + model.Resume;
            object obj = new object(); obj = responseModel.data;

            try
            {
                using (var scope = new TransactionScope())
                {
                    var objuser = new DBManager.UserMaster
                    {
                        FullName     = model.FullName,
                        EmailID      = model.EmailID,
                        Password     = Common.Common.Encryptdata(model.Password),
                        MobileNumber = model.MobileNumber,
                        TotalExYear  = model.TotalExYear,
                        Gender       = model.Gender,
                        Resume       = obj.ToString(),
                        Active       = true,
                        CreatedDate  = DateTime.Now,
                        Role         = "User",
                        Extension    = model.Extension
                    };
                    _unitofwork.UserMastersRepository.Insert(objuser);
                    _unitofwork.Save();
                    scope.Complete();
                    responseModel.message      = "Succuess";
                    responseModel.UserID       = objuser.UserID;
                    responseModel.EmailID      = objuser.EmailID;
                    responseModel.FullName     = objuser.FullName;
                    responseModel.MobileNumber = objuser.MobileNumber;
                    responseModel.Role         = objuser.Role;
                    responseModel.status       = true;

                    return(responseModel);
                }
            }
            catch (Exception ex)
            {
                responseModel.status  = false;
                responseModel.message = ex.Message;
            }
            return(responseModel);
        }