public async Task <IpMasterViewModel> GetIpAddressById(long Id)
        {
            var IpAddress = _ipMasterRepository.GetById(Id);

            if (IpAddress == null)
            {
                return(null);
            }

            var currentIpAddress = new IpMasterViewModel
            {
                Id          = IpAddress.Id,
                UserId      = IpAddress.UserId,
                IpAddress   = IpAddress.IpAddress,
                IsEnable    = IpAddress.IsEnable,
                IsDeleted   = IpAddress.IsDeleted,
                CreatedDate = IpAddress.CreatedDate,
                CreatedBy   = IpAddress.CreatedBy,
                UpdatedDate = IpAddress.UpdatedDate,
                UpdatedBy   = IpAddress.UpdatedBy,
                Status      = 0,
            };

            return(currentIpAddress);
        }
Exemple #2
0
        public void Update(long Id)
        {
            var tempdata = _tempRepository.GetById(Id);

            tempdata.SetAsOTPStatus();
            tempdata.SetAsUpdateDate(tempdata.UserId);
            _tempRepository.Update(tempdata);
        }
Exemple #3
0
        public void UpdateOtp(long Id)
        {
            var tempdata = _customRepository.GetById(Convert.ToInt16(Id));

            tempdata.SetAsOTPStatus();
            tempdata.SetAsUpdateDate(tempdata.UserId);
            //tempdata.Status = true;
            _customRepository.Update(tempdata);
        }
Exemple #4
0
 public void UpdateOtp(long Id)
 {
     try
     {
         var tempdata = _customRepository.GetById(Id);
         tempdata.SetAsPasswordStatus();
         tempdata.SetAsUpdateDate(tempdata.Id);
         _customRepository.Update(tempdata);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "An unexpected exception occured,\nMethodName:" + System.Reflection.MethodBase.GetCurrentMethod().Name + "\nClassname=" + this.GetType().Name, LogLevel.Error);
         throw;
     }
 }
Exemple #5
0
 public void Update(long Id)
 {
     try
     {
         var tempdata = _tempRepository.GetById(Id);
         tempdata.SetAsStatus();
         tempdata.SetAsUpdateDate(tempdata.Id);
         _tempRepository.Update(tempdata);
     }
     catch (Exception ex)
     {
         ex.ToString();
         //throw;
     }
 }
        public async Task <CustomEntity> Create(CustomDto customDto)
        {
            try
            {
                var entity = customDto.ToEntity();

                _customRepository.Add(entity);

                // it will be null
                var testEntity = await _customRepository.GetById(entity.Id);

                // If everything is ok then:
                await _uow.Commit();

                // The product will be added only after commit
                testEntity = await _customRepository.GetById(entity.Id);

                return(testEntity);
            }
            catch (Exception e)
            {
                throw e;
            }
        }