public int Create(Nomination.Domain.RequestForConfirmation.RequestForConfirmation obj, string userId)
        {
            //map business to entity framework
            tb_naesb_transaction_master entity = new ModelFactory(userId).Map(obj);

            //insert to database
            base.Add(entity);

            return(Convert.ToInt32(entity.TransMasterId));
        }
        //public Nomination.Domain.RequestForConfirmation.RequestForConfirmation Invoke(int id)
        //{
        //    return Map(_repository.Get(id));
        //}
        private Nomination.Domain.RequestForConfirmation.RequestForConfirmation Map(Nomination.Domain.RequestForConfirmation.RequestForConfirmation obj)
        {
            if (obj != null)
            {
                obj.PartyIndentificaton.PipelineEntity = _naesbPipelineGetService.Invoke(obj.PartyIndentificaton.PipelineEntity).Pipeline;
                obj.PartyIndentificaton.UtilityEntity  = _naesbUtilityGetService.Invoke(obj.PartyIndentificaton.UtilityEntity).Utility;

                return(obj);
            }

            return(null);
        }
예제 #3
0
 public int Invoke(Nomination.Domain.RequestForConfirmation.RequestForConfirmation obj)
 {
     return(_repository.Create(obj, _settings.UserId));
 }
예제 #4
0
        ///////////////////////////////////////////////////
        /// NaesbQuickResponse
        ///////////////////////////////////////////////////
        //public Nomination.Domain.Naesb.QuickResponse.NaesbQuickResponse MapQr(Nomination.Domain.Naesb.ConfirmationResponse.NaesbConfirmationResponse obj)
        //{
        //    if (obj != null)
        //    {
        //        Nomination.Domain.Naesb.QuickResponse.NaesbQuickResponse item =
        //            new Nomination.Domain.Naesb.QuickResponse.NaesbQuickResponse
        //            {
        //                Header = new Nomination.Domain.Naesb.QuickResponse.Header
        //                {
        //                    PartnerId = obj.Header.,
        //                    Standard = hdr.Standard,
        //                    Version = hdr.Version,
        //                    TransactionSet = hdr.TransactionSet,
        //                    EnvironmentFlag = hdr.EnvironmentFlag
        //                },
        //                PurposeCode = "27",
        //                PurchaseOrderNumber = obj.Header.TransactionIdentifier,
        //                PartyIndentificaton = Map(obj.PartyIndentificaton)
        //            };

        //        return item;
        //    }

        //    return null;
        //}

        ///////////////////////////////////////////////////
        /// RequestForConfirmation
        ///////////////////////////////////////////////////
        public Nomination.Domain.RequestForConfirmation.Naesb.NaesbRequestForConfirmation Map(Header hdr, Nomination.Domain.RequestForConfirmation.RequestForConfirmation obj)
        {
            if (obj != null)
            {
                Nomination.Domain.RequestForConfirmation.Naesb.NaesbRequestForConfirmation item =
                    new Nomination.Domain.RequestForConfirmation.Naesb.NaesbRequestForConfirmation
                {
                    Header = new Nomination.Domain.RequestForConfirmation.Naesb.Header
                    {
                        PartnerId       = hdr.PartnerId,
                        Standard        = hdr.Standard,
                        Version         = hdr.Version,
                        TransactionSet  = hdr.TransactionSet,
                        EnvironmentFlag = hdr.EnvironmentFlag
                    },
                    PurposeCode         = "00",
                    PurchaseOrderNumber = obj.PurchaseOrderNumber,
                    PartyIndentificaton = Map(obj.PartyIndentificaton),
                    Nominations         = Map(obj.GasDayStart, obj.GasDayEnd, obj.GasDay, obj.Cycle, obj.Locations)
                };

                return(item);
            }

            return(null);
        }