private IEnumerable<TransporterChequeViewModel> BindTransporterChequeViewModel(IEnumerable<TransporterCheque> transporterCheques)
 {
     var transporterChequeViewModels = new List<TransporterChequeViewModel>();
     foreach (var transporterCheque in transporterCheques)
     {
         var transporterChequeDetailObj = transporterCheque.TransporterChequeDetails.FirstOrDefault();
         if (transporterChequeDetailObj != null)
         {
             var transporterObj = transporterChequeDetailObj.TransporterPaymentRequest.TransportOrder.Transporter;
             var transporterChequeViewModel = new TransporterChequeViewModel
                                                  {
                                                      TransporterChequeId = transporterCheque.TransporterChequeId,
                                                      CheckNo = transporterCheque.CheckNo,
                                                      PaymentVoucherNo = transporterCheque.PaymentVoucherNo,
                                                      BankName = transporterCheque.BankName,
                                                      Amount = transporterCheque.Amount,
                                                      TransporterId = transporterObj.TransporterID,
                                                      PreparedBy = _userProfileService.FindById((int)transporterCheque.PreparedBy).FirstName + " " + _userProfileService.FindById((int)transporterCheque.PreparedBy).LastName,
                                                      AppovedBy = transporterCheque.AppovedBy != null? _userProfileService.FindById((int)transporterCheque.AppovedBy).FirstName + " " + _userProfileService.FindById((int)transporterCheque.AppovedBy).LastName: string.Empty,
                                                      AppovedDate = transporterCheque.AppovedDate,
                                                      Status = (int)transporterCheque.Status
                                                  };
             transporterChequeViewModels.Add(transporterChequeViewModel);
         }
     }
     return transporterChequeViewModels;
 }
Пример #2
0
        private TransporterChequeViewModel BindTransporterChequeViewModel(TransporterCheque transporterCheque)
        {
            TransporterChequeViewModel transporterChequeViewModel = null;
            if (transporterCheque != null)
            {
                var transporterChequeDetailObj = transporterCheque.TransporterChequeDetails.FirstOrDefault();
                if (transporterChequeDetailObj != null)
                {
                    var transporterObj = transporterChequeDetailObj.TransporterPaymentRequest.TransportOrder.Transporter;

                    transporterChequeViewModel = new TransporterChequeViewModel
                                                     {
                                                         TransporterChequeId = transporterCheque.TransporterChequeId,
                                                         CheckNo = transporterCheque.CheckNo,
                                                         PaymentVoucherNo = transporterCheque.PaymentVoucherNo,
                                                         BankName = transporterCheque.BankName,
                                                         PaymentDate = transporterCheque.PaymentDate,
                                                         Amount = transporterCheque.Amount,
                                                         TransporterId = transporterObj.TransporterID,
                                                         Transporter = _transporterService.FindById(transporterObj.TransporterID).Name,
                                                         PreparedBy =
                                                             _userProfileService.FindById(
                                                                 (int) transporterCheque.PreparedBy).FirstName + " " +
                                                             _userProfileService.FindById(
                                                                 (int) transporterCheque.PreparedBy).LastName,
                                                         AppovedBy = transporterCheque.AppovedBy != null
                                                                         ? _userProfileService.FindById(
                                                                             (int) transporterCheque.AppovedBy).
                                                                               FirstName + " " +
                                                                           _userProfileService.FindById(
                                                                               (int) transporterCheque.AppovedBy).
                                                                               LastName
                                                                         : string.Empty,
                                                         AppovedDate = transporterCheque.AppovedDate,
                                                         Status = (int) transporterCheque.Status
                                                     };
                }
            }
            return transporterChequeViewModel;
        }
 private TransporterChequeViewModel BindTransporterChequeViewModel(TransporterCheque transporterCheque)
 {
     TransporterChequeViewModel transporterChequeViewModel = null;
     if (transporterCheque != null)
     {
         transporterChequeViewModel = new TransporterChequeViewModel
         {
             TransporterChequeId = transporterCheque.TransporterChequeId,
             PaymentRequestID = transporterCheque.PaymentRequestID,
             CheckNo = transporterCheque.CheckNo,
             PaymentVoucherNo = transporterCheque.PaymentVoucherNo,
             BankName = transporterCheque.BankName,
             Amount = transporterCheque.Amount,
             TransporterId = _paymentRequestservice.FindById(transporterCheque.PaymentRequestID).TransportOrder.TransporterID,
             PreparedBy = _userProfileService.FindById((int)transporterCheque.PreparedBy).FirstName + " " +
                 _userProfileService.FindById((int)transporterCheque.PreparedBy).LastName,
             AppovedBy = transporterCheque.AppovedBy != null ?
                 _userProfileService.FindById((int)transporterCheque.AppovedBy).FirstName + " " +
                 _userProfileService.FindById((int)transporterCheque.AppovedBy).LastName : string.Empty,
             AppovedDate = transporterCheque.AppovedDate,
             Status = (int) transporterCheque.Status
         };
     }
     return transporterChequeViewModel;
 }