/// <summary>
        /// This Function Will Update Joint Account Contact Information Of Introducing Broker
        /// </summary>
        /// <param name="userID">userID</param>
        /// <param name="jointAccountInformation">jointAccountInformation</param>
        /// <returns>result</returns>
        public bool UpdateJointContactInforamation(int userID, JointAccountInformation jointAccountInformation)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var introducingBrokerRepo =
                        new IntroducingBrokerRepository(new EFRepository <IntroducingBroker>(), unitOfWork);

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

                    var updateRow = introducingBrokerObjSet.Where(x => x.FK_UserID == userID).
                                    Include("JointAccountInformations").Include("User").FirstOrDefault();

                    //Update particular column values
                    updateRow.JointAccountInformations.FirstOrDefault().TelephoneNumber = jointAccountInformation.TelephoneNumber;
                    updateRow.JointAccountInformations.FirstOrDefault().MobileNumber    = jointAccountInformation.MobileNumber;
                    updateRow.User.UserEmailID = jointAccountInformation.EmailAddress;
                    //if (updateRow.AssetManagers.FirstOrDefault() != null)
                    //{
                    //    updateRow.AssetManagers.FirstOrDefault().UserEmail = jointAccountInformation.EmailAddress;
                    //}

                    //Save changes
                    introducingBrokerRepo.Save();
                }
                return(true);
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                return(true);
            }
        }
Exemple #2
0
 public void Delete(JointAccountInformation entity)
 {
     Repository.Delete(entity);
 }
Exemple #3
0
 public void Add(JointAccountInformation entity)
 {
     Repository.Add(entity);
 }