예제 #1
0
        /// <summary>
        /// This method updates IB profit share for a particular program
        /// </summary>
        /// <param name="programID">programID</param>
        /// <param name="iBPerformanceFeeShare">iBPerformanceFeeShare</param>
        /// <param name="iBManagemantFeeShare">iBManagemantFeeShare</param>
        /// <param name="iBCommissionMarkupShare">iBCommissionMarkupShare</param>
        /// <param name="iBSpreadMarkupShare">iBSpreadMarkupShare</param>
        /// <param name="iBMaskedOffering">iBMaskedOffering</param>
        /// <returns></returns>
        public bool UpdateIBProfitShare(int programID, double iBPerformanceFeeShare, double iBManagemantFeeShare, double iBCommissionMarkupShare, double iBSpreadMarkupShare, bool iBMaskedOffering)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accProgramRepo =
                        new ManagedAccountProgramRepository(new EFRepository <ManagedAccountProgram>(), unitOfWork);

                    ObjectSet <ManagedAccountProgram> programObjSet =
                        ((CurrentDeskClientsEntities)accProgramRepo.Repository.UnitOfWork.Context).ManagedAccountPrograms;

                    //Get particular program
                    var program = programObjSet.Where(prgm => prgm.PK_ManagedAccPrgmID == programID).FirstOrDefault();
                    if (program != null)
                    {
                        program.IBPerformanceFeeShare   = iBPerformanceFeeShare;
                        program.IBManagemantFeeShare    = iBManagemantFeeShare;
                        program.IBCommissionMarkupShare = iBCommissionMarkupShare;
                        program.IBSpreadMarkupShare     = iBSpreadMarkupShare;
                        program.IBMaskedOffering        = iBMaskedOffering;
                        accProgramRepo.Save();
                        return(true);
                    }

                    return(false);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                return(false);
            }
        }
예제 #2
0
        /// <summary>
        /// This method enables a program of AM
        /// </summary>
        /// <param name="programID">programID</param>
        /// <returns></returns>
        public bool EnableManagedAccountProgram(int programID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accProgramRepo =
                        new ManagedAccountProgramRepository(new EFRepository <ManagedAccountProgram>(), unitOfWork);

                    ObjectSet <ManagedAccountProgram> programObjSet =
                        ((CurrentDeskClientsEntities)accProgramRepo.Repository.UnitOfWork.Context).ManagedAccountPrograms;

                    var program = programObjSet.Where(prgm => prgm.PK_ManagedAccPrgmID == programID).FirstOrDefault();
                    if (program != null)
                    {
                        program.IsEnabled = true;
                        accProgramRepo.Save();
                        return(true);
                    }

                    return(false);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
예제 #3
0
        // Add your own data access methods here.  If you wish to
        // expose your public method to a WCF service, marked them with
        // the attribute [NCPublish], and another T4 template will generate your service contract

        /// <summary>
        /// This method adds new managed account program for Asset Manager
        /// </summary>
        /// <param name="program"></param>
        /// <returns></returns>
        public bool AddNewManagedAccount(ManagedAccountProgram program)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accProgramRepo =
                        new ManagedAccountProgramRepository(new EFRepository <ManagedAccountProgram>(), unitOfWork);

                    accProgramRepo.Add(program);
                    accProgramRepo.Save();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                return(false);
            }
        }
예제 #4
0
        /// <summary>
        /// This method returns details of a account program
        /// </summary>
        /// <param name="programID">programID</param>
        /// <returns></returns>
        public ManagedAccountProgram GetProgramDetails(int programID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accProgramRepo =
                        new ManagedAccountProgramRepository(new EFRepository <ManagedAccountProgram>(), unitOfWork);

                    ObjectSet <ManagedAccountProgram> programObjSet =
                        ((CurrentDeskClientsEntities)accProgramRepo.Repository.UnitOfWork.Context).ManagedAccountPrograms;

                    return(programObjSet.Where(prgm => prgm.PK_ManagedAccPrgmID == programID).FirstOrDefault());
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
예제 #5
0
        /// <summary>
        /// This method returns list of managed programs for asset manager
        /// </summary>
        /// <param name="assetManagerUserID">assetManagerUserID</param>
        /// <returns></returns>
        public List <ManagedAccountProgram> GetAllManagedAccPrograms(int assetManagerUserID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accProgramRepo =
                        new ManagedAccountProgramRepository(new EFRepository <ManagedAccountProgram>(), unitOfWork);

                    ObjectSet <ManagedAccountProgram> programObjSet =
                        ((CurrentDeskClientsEntities)accProgramRepo.Repository.UnitOfWork.Context).ManagedAccountPrograms;

                    return(programObjSet.Where(prgm => prgm.FK_UserID == assetManagerUserID).ToList());
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }