Exemple #1
0
        /// <summary>
        /// This Function Will Get The Individual Name
        /// </summary>
        /// <param name="clientID">clientID</param>
        /// <param name="accType">accType</param>
        /// <returns></returns>
        public string GetLiveIndividualName(int clientID, LoginAccountType accType)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var trustDetailsRepo =
                        new TrustAccountInformationRepository(new EFRepository <TrustAccountInformation>(), unitOfWork);

                    ObjectSet <TrustAccountInformation> trustObjSet =
                        ((CurrentDeskClientsEntities)trustDetailsRepo.Repository.UnitOfWork.Context).TrustAccountInformations;

                    if (accType == LoginAccountType.LiveAccount)
                    {
                        var res = trustObjSet.Where(ind => ind.FK_ClientID == clientID).FirstOrDefault();
                        return(res != null ? res.TrustName : null);
                    }
                    else if (accType == LoginAccountType.PartnerAccount)
                    {
                        var res = trustObjSet.Where(ind => ind.FK_IntroducingBrokerID == clientID).FirstOrDefault();
                        return(res != null ? res.TrustName : null);
                    }
                    return(string.Empty);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
Exemple #2
0
        /// <summary>
        /// This method returns trust account details of a particular client
        /// </summary>
        /// <param name="clientID">clientID</param>
        /// <returns></returns>
        public TrustAccountInformation GetTrustAccountDetails(int clientID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var trustDetailsRepo =
                        new TrustAccountInformationRepository(new EFRepository <TrustAccountInformation>(), unitOfWork);

                    ObjectSet <TrustAccountInformation> trustObjSet =
                        ((CurrentDeskClientsEntities)trustDetailsRepo.Repository.UnitOfWork.Context).TrustAccountInformations;

                    return(trustObjSet.Where(trst => trst.FK_ClientID == clientID).FirstOrDefault());
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }