Esempio n. 1
0
            public static void transferClientSwitchToIFA(List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> listClientSwitchDetails, string strUserID, Boolean isContribution, Boolean isDeletePreviousDetails)
            {
                clsSwitchScheme SwitchIFA = new clsSwitchScheme(listClientSwitchDetails[0].propSwitchScheme.propSwitchID);

                string strClientID = SwitchIFA.propClient.propClientID;
                string strSchemeID = SwitchIFA.propScheme.propSchemeID;

                List <clsSwitchScheme.clsSwitchSchemeDetails> listSwitchDetailsIFA = new clsSwitchScheme(new clsScheme(strClientID, strSchemeID)).propSwitchDetails;
                List <clsSwitchScheme.clsSwitchSchemeDetails> newListSwitchDetails = new List <clsSwitchScheme.clsSwitchSchemeDetails>();

                if (isDeletePreviousDetails)
                {
                    deleteAllDetails(SwitchIFA.propSwitchID);
                }

                foreach (clsSwitchScheme_Client.clsSwitchSchemeDetails_Client SwitchDetails_Client in listClientSwitchDetails)
                {
                    clsSwitchScheme.clsSwitchSchemeDetails newSwitchDetails = new clsSwitchScheme.clsSwitchSchemeDetails();
                    newSwitchDetails.propSwitchScheme   = new clsSwitchScheme(SwitchIFA.propSwitchID);
                    newSwitchDetails.propFund           = new clsFund(SwitchDetails_Client.propFund.propFundID);
                    newSwitchDetails.propAllocation     = SwitchDetails_Client.propAllocation;
                    newSwitchDetails.propIsDeletable    = SwitchDetails_Client.propIsDeletable;
                    newSwitchDetails.propIsContribution = isContribution;

                    newListSwitchDetails.Add(newSwitchDetails);
                }

                clsSwitchScheme.clsSwitchSchemeDetails.insertSwitchDetails(newListSwitchDetails, strUserID, SwitchIFA.propSwitchID, isContribution);
            }
Esempio n. 2
0
            public static List <clsSwitchSchemeDetails> addFund(int intNewFundID, List <clsSwitchSchemeDetails> currentlistSwitchDetails, string strClientID, string strClientCurrency, string strUserID, Boolean isContribution)
            {
                float fTotalAllocation = 0;
                float fTotalValue      = currentlistSwitchDetails[0].propTotalValue;

                foreach (clsSwitchScheme.clsSwitchSchemeDetails SwitchDetail in currentlistSwitchDetails)
                {
                    fTotalAllocation = fTotalAllocation + SwitchDetail.propAllocation;

                    if (SwitchDetail.propFund.propFundID == intNewFundID)
                    {
                        throw new Exception("Fund already exists.");
                    }
                }

                clsSwitchScheme.clsSwitchSchemeDetails NewSwitchDetail = new clsSwitchScheme.clsSwitchSchemeDetails();

                NewSwitchDetail.propCreated_By         = strUserID;
                NewSwitchDetail.propFund               = new clsFund(intNewFundID);
                NewSwitchDetail.propIsDeletable        = true;
                NewSwitchDetail.propSwitchDetailsID    = 0;
                NewSwitchDetail.propSwitchScheme       = NewSwitchDetail.propSwitchScheme;
                NewSwitchDetail.propTotalAllocation    = fTotalAllocation;
                NewSwitchDetail.propCurrencyMultiplier = clsCurrency.getCurrencyMultiplier(strClientID, NewSwitchDetail.propFund.propCurrency);
                NewSwitchDetail.propIsContribution     = isContribution;

                currentlistSwitchDetails.Add(NewSwitchDetail);

                return(currentlistSwitchDetails);
            }
            public static void transferClientSwitchToIFA(List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> listClientSwitchDetails, string strUserID, Boolean isContribution)
            {
                clsSwitchScheme SwitchIFA = new clsSwitchScheme(listClientSwitchDetails[0].propSwitchScheme.propSwitchID);

                string strClientID = SwitchIFA.propClient.propClientID;
                string strSchemeID = SwitchIFA.propScheme.propSchemeID;                
                
                List<clsSwitchScheme.clsSwitchSchemeDetails> listSwitchDetailsIFA = new clsSwitchScheme(new clsScheme(strClientID, strSchemeID)).propSwitchDetails;
                List<clsSwitchScheme.clsSwitchSchemeDetails> newListSwitchDetails = new List<clsSwitchScheme.clsSwitchSchemeDetails>();

                foreach (clsSwitchScheme_Client.clsSwitchSchemeDetails_Client SwitchDetails_Client in listClientSwitchDetails)
                {
                    clsSwitchScheme.clsSwitchSchemeDetails newSwitchDetails = new clsSwitchScheme.clsSwitchSchemeDetails();
                    newSwitchDetails.propSwitchScheme = new clsSwitchScheme(SwitchIFA.propSwitchID);
                    newSwitchDetails.propFund = new clsFund(SwitchDetails_Client.propFund.propFundID);
                    newSwitchDetails.propAllocation = SwitchDetails_Client.propAllocation;
                    newSwitchDetails.propIsDeletable = SwitchDetails_Client.propIsDeletable;
                    newSwitchDetails.propIsContribution = isContribution;

                    newListSwitchDetails.Add(newSwitchDetails);

                }

                clsSwitchScheme.clsSwitchSchemeDetails.insertSwitchDetails(newListSwitchDetails, strUserID, SwitchIFA.propSwitchID, isContribution);
            }
            public static List<clsSwitchSchemeDetails> addFund(int intNewFundID, List<clsSwitchSchemeDetails> currentlistSwitchDetails, string strClientID, string strClientCurrency, string strUserID, Boolean isContribution)
            {

                float fTotalAllocation = 0;
                float fTotalValue = currentlistSwitchDetails[0].propTotalValue;

                foreach (clsSwitchScheme.clsSwitchSchemeDetails SwitchDetail in currentlistSwitchDetails)
                {
                    fTotalAllocation = fTotalAllocation + SwitchDetail.propAllocation;

                    if (SwitchDetail.propFund.propFundID == intNewFundID)
                    {
                        throw new Exception("Fund already exists.");
                    }
                }

                clsSwitchScheme.clsSwitchSchemeDetails NewSwitchDetail = new clsSwitchScheme.clsSwitchSchemeDetails();

                NewSwitchDetail.propCreated_By = strUserID;
                NewSwitchDetail.propFund = new clsFund(intNewFundID);
                NewSwitchDetail.propIsDeletable = true;
                NewSwitchDetail.propSwitchDetailsID = 0;
                NewSwitchDetail.propSwitchScheme = NewSwitchDetail.propSwitchScheme;
                NewSwitchDetail.propTotalAllocation = fTotalAllocation;
                NewSwitchDetail.propCurrencyMultiplier = clsCurrency.getCurrencyMultiplier(strClientID, NewSwitchDetail.propFund.propCurrency);
                NewSwitchDetail.propIsContribution = isContribution;
                
                currentlistSwitchDetails.Add(NewSwitchDetail);

                return currentlistSwitchDetails;

            }