Example #1
0
 public void Add(VLCWallet vLCWallet)
 {
     if (vLCWallet != null)
     {
         _repository.VLCWallets.Add(vLCWallet);
     }
 }
Example #2
0
        public void UpdateVLCWalletForDockCollection(int vlcId, decimal totalAmount, bool isCredit)
        {
            var vlcWallet = unitOfWork.VLCWalletRepository.GetByVLCId(vlcId);

            if (vlcWallet != null)
            {
                if (isCredit)
                {
                    vlcWallet.WalletBalance -= totalAmount;
                }
                else
                {
                    vlcWallet.WalletBalance += totalAmount;
                }
                vlcWallet.AmountDueDate = vlcWallet.AmountDueDate.AddDays(10);
                unitOfWork.VLCWalletRepository.Update(vlcWallet);
            }
            else
            {
                VLCWallet vLCWallet = new VLCWallet();
                vLCWallet.WalletId = unitOfWork.DashboardRepository.NextNumberGenerator("VLCWallet");
                vLCWallet.VLCId    = vlcId;
                if (isCredit)
                {
                    vlcWallet.WalletBalance -= totalAmount;
                }
                else
                {
                    vlcWallet.WalletBalance += totalAmount;
                }
                vLCWallet.AmountDueDate = DateTimeHelper.GetISTDateTime().AddDays(10);
                unitOfWork.VLCWalletRepository.Add(vLCWallet);
            }
        }
Example #3
0
 public void Update(VLCWallet vLCWallet)
 {
     if (vLCWallet != null)
     {
         _repository.Entry <Sql.VLCWallet>(vLCWallet).State = System.Data.Entity.EntityState.Modified;
         //  _repository.SaveChanges();
     }
 }
Example #4
0
        public void AddVLCWallet(VLC vLC)
        {
            VLCWallet vLCWallet = new VLCWallet();

            vLCWallet.WalletId      = unitOfWork.DashboardRepository.NextNumberGenerator("VLCWallet");
            vLCWallet.VLCId         = vLC.VLCId;
            vLCWallet.WalletBalance = 0;
            vLCWallet.AmountDueDate = DateTimeHelper.GetISTDateTime().AddDays(10);
            unitOfWork.VLCWalletRepository.Add(vLCWallet);
        }
Example #5
0
        public static VLCWalletDTO ConvertToVLCWalletDTO(VLCWallet vLCWallet)
        {
            VLCWalletDTO vLCWalletDTO = new VLCWalletDTO();

            vLCWalletDTO.VLCId         = vLCWallet.VLCId;
            vLCWalletDTO.VLCCode       = vLCWallet.VLC != null ? vLCWallet.VLC.VLCCode : string.Empty;
            vLCWalletDTO.VLCName       = vLCWallet.VLC != null ? vLCWallet.VLC.VLCName : string.Empty;
            vLCWalletDTO.WalletBalance = vLCWallet.WalletBalance;
            vLCWalletDTO.WalletId      = vLCWallet.WalletId;
            return(vLCWalletDTO);
        }