/// <summary>
        /// This method returns partner name based on userIDs
        /// </summary>
        /// <param name="userID">userID</param>
        /// <returns></returns>
        public string GetPartnerName(int userID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var introducingBrokerRepo =
                        new IntroducingBrokerRepository(new EFRepository <IntroducingBroker>(), unitOfWork);


                    ObjectSet <IntroducingBroker> introducingBrokerObjSet =
                        ((CurrentDeskClientsEntities)introducingBrokerRepo.Repository.UnitOfWork.Context).IntroducingBrokers;

                    //Get The Selected tunning and assign its Properties.
                    var selectedIB =
                        introducingBrokerObjSet.Where(ib => ib.FK_UserID == userID).FirstOrDefault();

                    //Check for nullability
                    if (selectedIB != null)
                    {
                        //Get account type details
                        var accTypeBO          = new AccountTypeBO();
                        var accountTypeDetails = accTypeBO.GetAccountTypeAndFormTypeValue((int)selectedIB.FK_AccountTypeID);

                        if (accountTypeDetails.FK_AccountTypeValue == Constants.K_ACCT_INDIVIDUAL)
                        {
                            var individualAccountBO = new IndividualAccountInformationBO();
                            return(individualAccountBO.GetPartnerIndividualName(selectedIB.PK_IntroducingBrokerID));
                        }
                        else if (accountTypeDetails.FK_AccountTypeValue == Constants.K_ACCT_JOINT)
                        {
                            var jointAccountBO = new JointAccountInformationBO();
                            return(jointAccountBO.GetPartnerIndividualName(selectedIB.PK_IntroducingBrokerID));
                        }
                        else if (accountTypeDetails.FK_AccountTypeValue == Constants.K_ACCT_CORPORATE)
                        {
                            var corporateAccountBO = new CorporateAccountInformationBO();
                            return(corporateAccountBO.GetPartnerIndividualName(selectedIB.PK_IntroducingBrokerID));
                        }
                        else if (accountTypeDetails.FK_AccountTypeValue == Constants.K_ACCT_TRUST)
                        {
                            var trustAccountBO = new TrustAccountInformationBO();
                            return(trustAccountBO.GetPartnerIndividualName(selectedIB.PK_IntroducingBrokerID));
                        }
                    }

                    return(String.Empty);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                return(String.Empty);
            }
        }
        /// <summary>
        /// This method returns Introducing Broker details
        /// </summary>
        /// <param name="userID">userID</param>
        /// <param name="accountType">accountType</param>
        /// <param name="accountCode">accountCode</param>
        /// <param name="userDisplayName">userDisplayName</param>
        /// <param name="organizationID">organizationID</param>
        /// <returns></returns>
        public bool GetClientAccountInformation(int userID, ref int accountType, ref int accountCode, ref string userDisplayName, ref int organizationID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var ibRepo =
                        new IntroducingBrokerRepository(new EFRepository <IntroducingBroker>(), unitOfWork);

                    ObjectSet <IntroducingBroker> ibObjSet =
                        ((CurrentDeskClientsEntities)ibRepo.Repository.UnitOfWork.Context).IntroducingBrokers;

                    var selectedClient = ibObjSet.Where(usr => usr.FK_UserID == userID).FirstOrDefault();

                    if (selectedClient != null)
                    {
                        accountType    = (int)selectedClient.FK_AccountTypeID;
                        accountCode    = (int)selectedClient.FK_AccountID;
                        organizationID = selectedClient.FK_OrganizationID;

                        if (accountType == Constants.K_PARTNER_INDIVIDUAL)
                        {
                            var individualAccountBO = new IndividualAccountInformationBO();
                            userDisplayName = individualAccountBO.GetLiveIndividualName(selectedClient.PK_IntroducingBrokerID, LoginAccountType.PartnerAccount);
                        }
                        else if (accountType == Constants.K_PARTNER_JOINT)
                        {
                            var jointAccountBO = new JointAccountInformationBO();
                            userDisplayName = jointAccountBO.GetLiveIndividualName(selectedClient.PK_IntroducingBrokerID, LoginAccountType.PartnerAccount);
                        }
                        else if (accountType == Constants.K_PARTNER_CORPORATE)
                        {
                            var corporateAccountBO = new CorporateAccountInformationBO();
                            userDisplayName = corporateAccountBO.GetLiveIndividualName(selectedClient.PK_IntroducingBrokerID, LoginAccountType.PartnerAccount);
                        }
                        else if (accountType == Constants.K_PARTNER_TRUST)
                        {
                            var trustAccountBO = new TrustAccountInformationBO();
                            userDisplayName = trustAccountBO.GetLiveIndividualName(selectedClient.PK_IntroducingBrokerID, LoginAccountType.PartnerAccount);
                        }
                        return(true);
                    }
                    return(false);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }