public ResponseDTO AddDistributionCenter(DistributionCenterDTO distributionCenterDTO)
        {
            this.CheckForExisitngDistributionCenter(distributionCenterDTO);
            ResponseDTO        responseDTO        = new ResponseDTO();
            DistributionCenter distributionCenter = new DistributionCenter();

            distributionCenter.DCId        = unitOfWork.DashboardRepository.NextNumberGenerator("DistributionCenter");
            distributionCenterDTO.Password = EncryptionHelper.Encryptword(distributionCenterDTO.Password);
            DistributionCenterConvertor.ConvertToDistributionCenterEntity(ref distributionCenter, distributionCenterDTO, false);
            //   customer.CustomerCode = unitOfWork.CustomerRepository.GetCustomerCodeIdByVLC(customerDto.VLCId);
            distributionCenter.DCCode       = "DC" + distributionCenter.DCId.ToString();
            distributionCenter.CreatedDate  = DateTimeHelper.GetISTDateTime();
            distributionCenter.ModifiedDate = DateTimeHelper.GetISTDateTime();
            distributionCenter.CreatedBy    = distributionCenter.ModifiedBy = "Admin";
            // unitOfWork.VLCRepository.GetEmployeeNameByVLCId(customerDto.VLCId);
            distributionCenter.DateOfRegistration = DateTimeHelper.GetISTDateTime().Date;
            distributionCenter.IsDeleted          = false;
            distributionCenter.Pin     = OTPGenerator.GetSixDigitOTP();
            distributionCenterDTO.DCId = distributionCenter.DCId;

            //creating Distribution Center wallet with Distribution Center
            AddDistributionCenterWallet(distributionCenter);
            DCAddress dCAddress = AddDistributionCenterAddress(distributionCenterDTO);

            if (dCAddress != null)
            {
                distributionCenter.DCAddresses.Add(dCAddress);
            }
            unitOfWork.DistributionCenterRepository.Add(distributionCenter);
            unitOfWork.SaveChanges();
            responseDTO.Status  = true;
            responseDTO.Message = String.Format("Distribution Center Successfully Created");
            responseDTO.Data    = DistributionCenterConvertor.ConvertToDistributionCenterDto(distributionCenter);
            return(responseDTO);
        }
        public ResponseDTO UpdateDistributionCenter(DistributionCenterDTO distributionCenterDTO)
        {
            var distributionCenter = unitOfWork.DistributionCenterRepository.GetById(distributionCenterDTO.DCId);

            if (distributionCenter != null)
            {
                DistributionCenterConvertor.ConvertToDistributionCenterEntity(ref distributionCenter, distributionCenterDTO, true);
                distributionCenter.ModifiedBy   = distributionCenter.AgentName;
                distributionCenter.ModifiedDate = DateTimeHelper.GetISTDateTime();
                unitOfWork.DistributionCenterRepository.Update(distributionCenter);
                unitOfWork.SaveChanges();
                ResponseDTO responseDTO = new ResponseDTO();
                responseDTO.Status  = true;
                responseDTO.Message = "Distribution Center Succesfully Updated";
                responseDTO.Data    = DistributionCenterConvertor.ConvertToDistributionCenterDto(distributionCenter);
                return(responseDTO);
            }
            else
            {
                throw new PlatformModuleException("Distribution Center Not Found with given DC Id");
            }
        }