Example #1
0
        public async Task <TempUserRegisterViewModel> AddTempRegister(TempUserRegisterViewModel model)
        {
            var currentTempReguser = new TempUserRegister
            {
                RegTypeId    = model.RegTypeId,
                Mobile       = model.Mobile,
                UserName     = model.UserName,
                FirstName    = model.FirstName,
                LastName     = model.LastName,
                PasswordHash = model.PasswordHash,
                Email        = model.Email,
                CreatedDate  = DateTime.UtcNow,
            };

            _dbContext.Add(currentTempReguser);
            _dbContext.SaveChanges();
            if (!(currentTempReguser.RegTypeId == Convert.ToInt16(Core.Enums.enRegisterType.Standerd)))
            {
                var obj = await _tempOtpService.AddTempOtp((int)currentTempReguser.Id, currentTempReguser.RegTypeId);

                TempUserRegisterViewModel temp = new TempUserRegisterViewModel();
                temp.Id             = currentTempReguser.Id;
                temp.RegTypeId      = currentTempReguser.RegTypeId;
                temp.UserName       = currentTempReguser.UserName;
                temp.Email          = currentTempReguser.Email;
                temp.RegisterStatus = currentTempReguser.RegisterStatus;

                return(temp);
            }
            else if (currentTempReguser != null)
            {
                TempUserRegisterViewModel temp = new TempUserRegisterViewModel();
                temp.Id             = currentTempReguser.Id;
                temp.RegTypeId      = currentTempReguser.RegTypeId;
                temp.UserName       = currentTempReguser.UserName;
                temp.Email          = currentTempReguser.Email;
                temp.RegisterStatus = currentTempReguser.RegisterStatus;
                return(temp);
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        public async Task <TempUserRegisterViewModel> GetEmailDet(string Email)
        {
            var userdata = _dbContext.TempUserRegister.Where(i => i.Email == Email).FirstOrDefault();
            TempUserRegisterViewModel model = new TempUserRegisterViewModel();

            if (userdata != null)
            {
                model.UserName       = userdata.UserName;
                model.FirstName      = userdata.FirstName;
                model.LastName       = userdata.LastName;
                model.Mobile         = userdata.Mobile;
                model.PasswordHash   = userdata.PasswordHash;
                model.RegisterStatus = userdata.RegisterStatus;
                model.Email          = userdata.Email;
                model.Id             = userdata.Id;
                return(model);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        public async Task <TempUserRegisterViewModel> FindById(long Id)
        {
            var userdata = _dbContext.TempUserRegister.Find(Id);
            TempUserRegisterViewModel model = new TempUserRegisterViewModel();

            if (userdata != null)
            {
                model.UserName       = userdata.UserName;
                model.FirstName      = userdata.FirstName;
                model.LastName       = userdata.LastName;
                model.Mobile         = userdata.Mobile;
                model.PasswordHash   = userdata.PasswordHash;
                model.RegisterStatus = userdata.RegisterStatus;
                model.Email          = userdata.Email;
                model.Id             = userdata.Id;
                return(model);
            }
            else
            {
                return(null);
            }
        }