/// <summary> /// This method saves referral link in IB table /// </summary> /// <param name="userID">userID</param> /// <param name="referralLink">referralLink</param> /// <returns></returns> public bool SaveReferralLink(int userID, string referralLink) { try { using (var unitOfWork = new EFUnitOfWork()) { var ibRepo = new IntroducingBrokerRepository(new EFRepository <IntroducingBroker>(), unitOfWork); ObjectSet <IntroducingBroker> ibObjSet = ((CurrentDeskClientsEntities)ibRepo.Repository.UnitOfWork.Context).IntroducingBrokers; var ibRow = ibObjSet.Include("User").Where(usr => usr.User.PK_UserID == userID).FirstOrDefault(); if (ibRow != null) { ibRow.CustomizedLink = referralLink; ibRepo.Save(); return(true); } return(false); } } catch (Exception ex) { CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); throw; } }
/// <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); } }
/// <summary> /// This Function Will Update The Joint-Account Personal Information of Introducing Broker /// </summary> /// <param name="userID">userID</param> /// <param name="phoneID">PhoneID</param> /// <returns>result</returns> public bool UpdateJointPersonalInformation(int userID, string phoneID) { 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").FirstOrDefault(); //Update particular column value updateRow.JointAccountInformations.FirstOrDefault().PhoneID = phoneID; //Save changes introducingBrokerRepo.Save(); } return(true); } catch (Exception ex) { CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); return(false); } }
/// <summary> /// This function will insert introducing broker details /// </summary> /// <param name="newIB">newIB</param> public void AddIntroducingBrokerDetails(IntroducingBroker newIB) { try { using (var unitOfWork = new EFUnitOfWork()) { var IBDetailsRepo = new IntroducingBrokerRepository(new EFRepository <IntroducingBroker>(), unitOfWork); IBDetailsRepo.Add(newIB); IBDetailsRepo.Save(); } } catch (Exception ex) { CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); throw; } }
/// <summary> /// This method updates Trustee Individual Auth Officer Contact Info based on FK_UserID from Introducing Broker table /// </summary> /// <param name="userID">userID</param> /// <param name="telCountryCode">telCountryCode</param> /// <param name="telNumber">telNumber</param> /// <param name="mobileCountryCode">mobileCountryCode</param> /// <param name="mobileNumber">mobileNumber</param> /// <param name="secEmailID">secEmailID</param> /// <returns>bool</returns> public bool UpdateTrusteeIndividualAuthOfficerContactInfo(int userID, string telCountryCode, string telNumber, string mobileCountryCode, string mobileNumber, string secEmailID) { 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("TrustAccountInformations").Include("AssetManagers").FirstOrDefault(); if (updateRow != null) { //Update particular column values updateRow.TrustAccountInformations.FirstOrDefault().TrusteeIndividualTelephoneNumber = telCountryCode + "-" + telNumber; updateRow.TrustAccountInformations.FirstOrDefault().TrusteeIndividualMobileNumber = mobileCountryCode + "-" + mobileNumber; updateRow.UserEmail = secEmailID; if (updateRow.AssetManagers.FirstOrDefault() != null) { updateRow.AssetManagers.FirstOrDefault().UserEmail = secEmailID; } //Save changes introducingBrokerRepo.Save(); return(true); } } return(false); } catch (Exception ex) { CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); return(true); } }