Ejemplo n.º 1
0
        /// <summary>
        /// Update data in case new/add sale and will insert new occurrence in case other installation type.
        /// </summary>
        /// <param name="doComplete"></param>
        public void CompleteInstallation(doCompleteInstallationData doComplete)
        {
            try
            {
                //Validation ServiceTypeCode and CompleteInstallationProcessFlag
                ApplicationErrorException.CheckMandatoryField <doCompleteInstallationData, doCompleteContractCompleteInstallation>(doComplete);

                //2. Check service type code and complete process flag
                if (doComplete.ServiceTypeCode == ServiceType.C_SERVICE_TYPE_RENTAL)
                {
                    if (doComplete.CompleteInstallationProcessFlag == FlagType.C_FLAG_ON)
                    {
                        IRentralContractHandler hand = ServiceContainer.GetService <IRentralContractHandler>() as IRentralContractHandler;
                        hand.CompleteInstallation(doComplete);
                    }
                    else if (doComplete.CompleteInstallationProcessFlag == FlagType.C_FLAG_OFF)
                    {
                        //do nothing
                    }
                }
                else if (doComplete.ServiceTypeCode == ServiceType.C_SERVICE_TYPE_SALE)
                {
                    ISaleContractHandler hand = ServiceContainer.GetService <ISaleContractHandler>() as ISaleContractHandler;
                    if (doComplete.CompleteInstallationProcessFlag == FlagType.C_FLAG_ON)
                    {
                        hand.CompleteInstallation(doComplete);
                    }
                    else if (doComplete.CompleteInstallationProcessFlag == FlagType.C_FLAG_OFF)
                    {
                        hand.CancelInstallation(doComplete);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }