Ejemplo n.º 1
0
        public ResponseDTO UpdateVLC(VLCDTO vlcDto)
        {
            var vlc = unitOfWork.VLCRepository.GetById(vlcDto.VLCId);

            VLCConvertor.ConvertToVLCEntity(ref vlc, vlcDto, true);
            vlc.ModifiedBy   = vlc.AgentName;
            vlc.ModifiedDate = DateTimeHelper.GetISTDateTime();
            unitOfWork.VLCRepository.Update(vlc);
            unitOfWork.SaveChanges();
            ResponseDTO responseDTO = new ResponseDTO();

            responseDTO.Status  = true;
            responseDTO.Message = "VLC Succesfully Updated";
            responseDTO.Data    = VLCConvertor.ConvertToVLCDto(vlc);
            return(responseDTO);
        }
Ejemplo n.º 2
0
        public ResponseDTO AddVLC(VLCDTO vlcDto)
        {
            //  this.CheckForExisitngCustomer(vlcDto.MobileNumber);
            ResponseDTO responseDTO = new ResponseDTO();
            VLC         vLC         = new VLC();

            vLC.VLCId             = unitOfWork.DashboardRepository.NextNumberGenerator("VLC");
            vLC.VLCCode           = unitOfWork.DashboardRepository.GenerateVLCCode(vlcDto.VLCName);
            vLC.CreatedDate       = DateTimeHelper.GetISTDateTime();
            vLC.ModifiedDate      = DateTimeHelper.GetISTDateTime();
            vLC.CreatedBy         = vlcDto.ModifiedBy = "Admin";
            vLC.VLCEnrollmentDate = DateTimeHelper.GetISTDateTime().Date;
            vLC.IsDeleted         = false;
            vlcDto.Password       = vlcDto.Password == null ? "Admin@123" : vlcDto.Password;
            vLC.Password          = EncryptionHelper.Encryptword(vlcDto.Password);
            VLCConvertor.ConvertToVLCEntity(ref vLC, vlcDto, false);
            unitOfWork.VLCRepository.Add(vLC);
            AddVLCWallet(vLC);
            responseDTO.Status  = true;
            responseDTO.Message = "VLC Succesfully Created";
            responseDTO.Data    = VLCConvertor.ConvertToVLCDto(vLC);
            unitOfWork.SaveChanges();
            return(responseDTO);
        }