Beispiel #1
0
        public PowerRequestDto MapToPowerRequestDto(PowerRequest powerrequest)
        {
            if (powerrequest != null)
            {
                var powerrequestDto = new PowerRequestDto
                {
                    Id                = powerrequest.Id,
                    Amount            = powerrequest.Amount,
                    Energyneeded      = powerrequest.Energyneeded,
                    IsConfirmed       = powerrequest.IsConfirmed,
                    Date              = powerrequest.Date,
                    RequestFrom       = powerrequest.RequestFrom,
                    Load              = powerrequest.Load,
                    SMID              = powerrequest.SMID,
                    ResponseFrom      = powerrequest.ResponseFrom,
                    TariffId          = powerrequest.TariffId,
                    TransactionStatus = powerrequest.TransactionStatus.GetDisplayName(),

                    CreateDate   = powerrequest.CreateDate,
                    ModifiedDate = powerrequest.ModifiedDate,
                    IsDeleted    = powerrequest.IsDeleted
                };

                return(powerrequestDto);
            }
            return(new PowerRequestDto());
        }
Beispiel #2
0
        public PowerRequest MapToPowerRequest(PowerRequestDto powerrequestDto)
        {
            return(new PowerRequest
            {
                Id = powerrequestDto.Id,
                Amount = powerrequestDto.Amount,
                Energyneeded = powerrequestDto.Energyneeded,
                IsConfirmed = powerrequestDto.IsConfirmed,
                Date = powerrequestDto.Date,
                RequestFrom = powerrequestDto.RequestFrom,
                Load = powerrequestDto.Load,
                SMID = powerrequestDto.SMID,
                ResponseFrom = powerrequestDto.ResponseFrom,
                TariffId = powerrequestDto.TariffId,
                //TransactionStatus = (TransactionStatus) powerrequestDto.TransactionStatus,

                CreateDate = powerrequestDto.CreateDate,
                ModifiedDate = powerrequestDto.ModifiedDate,
                IsDeleted = powerrequestDto.IsDeleted
            });
        }