Пример #1
0
        /// <summary>
        /// This Function will get the individual Username depending upon the
        /// ClientID
        /// </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 individualDetailsRepo =
                        new IndividualAccountInformationRepository(new EFRepository <IndividualAccountInformation>(), unitOfWork);

                    ObjectSet <IndividualAccountInformation> individualObjSet =
                        ((CurrentDeskClientsEntities)individualDetailsRepo.Repository.UnitOfWork.Context).IndividualAccountInformations;

                    if (accType == LoginAccountType.LiveAccount)
                    {
                        var res = individualObjSet.Where(ind => ind.FK_ClientID == clientID).FirstOrDefault();
                        return(res != null ? res.FirstName + " " + res.LastName : null);
                    }
                    else if (accType == LoginAccountType.PartnerAccount)
                    {
                        var res = individualObjSet.Where(ind => ind.FK_IntroducingBrokerID == clientID).FirstOrDefault();
                        return(res != null ? res.FirstName + " " + res.LastName : null);
                    }
                    return(string.Empty);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
Пример #2
0
        /// <summary>
        /// This function will insert individual account details for new client
        /// </summary>
        /// <param name="newClient">newClient</param>
        public void AddIndividualAccDetailsForNewClient(IndividualAccountInformation newClient)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var individualDetailsRepo =
                        new IndividualAccountInformationRepository(new EFRepository <IndividualAccountInformation>(), unitOfWork);

                    individualDetailsRepo.Add(newClient);
                    individualDetailsRepo.Save();
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
Пример #3
0
        /// <summary>
        /// This method returns individual information
        /// of a particular client
        /// </summary>
        /// <param name="clientID">clientID</param>
        /// <returns></returns>
        public IndividualAccountInformation GetIndividualAccountDetails(int clientID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var individualDetailsRepo =
                        new IndividualAccountInformationRepository(new EFRepository <IndividualAccountInformation>(), unitOfWork);

                    ObjectSet <IndividualAccountInformation> individualObjSet =
                        ((CurrentDeskClientsEntities)individualDetailsRepo.Repository.UnitOfWork.Context).IndividualAccountInformations;

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