Example #1
0
        private GrmEventComponentDto HydrateGrmEventRelatedEntities(int revenueObjectId, DateTime effectiveDate)
        {
            DateTime currentDate = DateTime.Today;

            GrmEventDto grmEvent = new GrmEventDto
            {
                BillNumber = string.Empty,
                BillTypeId = 0,
                EffDate    = effectiveDate,
                EffTaxYear = 0,
                EventDate  = currentDate,
                EventType  = GrmConstants.EventBvsValueHeaderOverride,
                EventTypeShortDescription = string.Empty,
                GRMModule = GrmConstants.ModuleAA,
                Info      = string.Empty,
                PIN       = string.Empty,
                RevObjId  = revenueObjectId
            };

            GrmEventGroupDto grmEventGroup = new GrmEventGroupDto()
            {
                DocNumber             = string.Empty,
                EndDate               = currentDate,
                EventGroupType        = GrmConstants.EventGroupBvsMaintenance,
                Info                  = string.Empty,
                ParentGRMEVentGroupId = 0,
                StartDate             = currentDate
            };

            TransactionDetailDto transactionDetail = new TransactionDetailDto
            {
                ObjectType = 0
            };

            TransactionHeaderDto transactionHeader = new TransactionHeaderDto
            {
                ChangeTimestamp = currentDate,
                CallingFunction = GrmConstants.CallingFunction,
                EffDate         = effectiveDate,
                EffTaxYear      = 0,
                IPAddr          = "",                         //this.getIpAddr(), //There might not be any value in getting the IP Address as this will be the IP of the service
                MACAddr         = "",                         //this.getMacAddr(), //There might not be any value in getting the MAC as this will be the MAC of the machine
                StartTimestamp  = currentDate,
                TaskName        = GrmConstants.TaskName,
                TranId          = 0,
                TranType        = 0,
                UserProfileId   = 0,                                //TODO - When Security implementation is complete
                WorkstationId   = Environment.MachineName,
            };

            GrmEventComponentDto grmEventComponent = new GrmEventComponentDto()
            {
                GrmEvent          = grmEvent,
                GrmEventGroup     = grmEventGroup,
                TransactionDetail = transactionDetail,
                TransactionHeader = transactionHeader
            };

            return(grmEventComponent);
        }
        public async Task <GrmEventDto> CreateBvsValueHeaderOverideGrmEvent(int revenueObjectId, DateTime effectiveDate)
        {
            DateTime currentDate = DateTime.Today;

            GrmEventDto grmEvent = new GrmEventDto
            {
                BillNumber = string.Empty,
                BillTypeId = 0,
                EffDate    = effectiveDate,
                EffTaxYear = 0,
                EventDate  = currentDate,
                EventType  = Constants.EventBvsValueHeaderOverride,
                EventTypeShortDescription = string.Empty,
                GRMModule = Constants.ModuleAA,
                Info      = string.Empty,
                PIN       = string.Empty,
                RevObjId  = revenueObjectId
            };

            GrmEventGroupDto grmEventGroup = new GrmEventGroupDto()
            {
                DocNumber             = string.Empty,
                EndDate               = currentDate,
                EventGroupType        = Constants.EventGroupBvsMaintenance,
                Info                  = string.Empty,
                ParentGRMEVentGroupId = 0,
                StartDate             = currentDate
            };

            TransactionDetailDto transactionDetail = new TransactionDetailDto
            {
                ObjectType = 0
            };

            TransactionHeaderDto transactionHeader = new TransactionHeaderDto
            {
                ChangeTimestamp = currentDate,
                CallingFunction = Constants.CallingFunction,
                EffDate         = effectiveDate,
                EffTaxYear      = 0,
                IPAddr          = GetIpAddr(),
                MACAddr         = GetMacAddr(),                          //TODO - Retrieval of MAC address
                StartTimestamp  = currentDate,
                TaskName        = Constants.TaskName,
                TranId          = 0,
                TranType        = 0,
                UserProfileId   = 0,                                //TODO - When Security implementation is complete
                WorkstationId   = Environment.MachineName,
            };

            GrmEventComponentDto grmEventComponent = new GrmEventComponentDto()
            {
                GrmEvent          = grmEvent,
                GrmEventGroup     = grmEventGroup,
                TransactionDetail = transactionDetail,
                TransactionHeader = transactionHeader
            };

            return(await _grmEventRepository.CreateGrmEvent(grmEventComponent));
        }