public CreateInvestor(int underwriterID, InvestorModel investor, IEnumerable <InvestorContactModel> contacts, IEnumerable <InvestorBankAccountModel> banks) { this.underwriterID = underwriterID; this.investor = investor; this.contacts = contacts; this.banks = banks; } //ctor
} //LoadFromDb private InvestorModel ContvertToModel(I_Investor dbInvestor) { var model = new InvestorModel { InvestorID = dbInvestor.InvestorID, InvestorType = new InvestorTypeModel { InvestorTypeID = dbInvestor.InvestorType.InvestorTypeID, Name = dbInvestor.InvestorType.Name }, Name = dbInvestor.Name, IsActive = dbInvestor.IsActive, Timestamp = dbInvestor.Timestamp, Contacts = new List <InvestorContactModel>(), Banks = new List <InvestorBankAccountModel>() }; foreach (var contact in dbInvestor.InvestorContacts) { model.Contacts.Add(new InvestorContactModel { InvestorID = contact.InvestorID, IsActive = contact.IsActive, IsGettingAlerts = contact.IsGettingAlerts, IsGettingReports = contact.IsGettingReports, Timestamp = contact.Timestamp, IsPrimary = contact.IsPrimary, Email = contact.Email, OfficePhone = contact.OfficePhone, PersonalName = contact.PersonalName, Mobile = contact.Mobile, Role = contact.Role, LastName = contact.LastName, InvestorContactID = contact.InvestorContactID, Comment = contact.Comment }); } foreach (var bank in dbInvestor.InvestorBankAccounts) { model.Banks.Add(new InvestorBankAccountModel { InvestorID = bank.InvestorID, IsActive = bank.IsActive, Timestamp = bank.Timestamp, InvestorBankAccountID = bank.InvestorBankAccountID, BankAccountNumber = bank.BankAccountNumber, BankAccountName = bank.BankAccountName, BankCode = bank.BankCode, BankBranchNumber = bank.BankBranchNumber, RepaymentKey = bank.RepaymentKey, BankName = bank.BankName, BankBranchName = bank.BankBranchName, BankCountryID = bank.BankCountryID, AccountType = new InvestorAccountTypeModel { Name = bank.AccountType.Name, InvestorAccountTypeID = bank.AccountType.InvestorAccountTypeID } }); } return(model); } //ContvertToModel
public IntActionResult CreateInvestor(int underwriterID, InvestorModel investor, IEnumerable <InvestorContactModel> investorContacts, IEnumerable <InvestorBankAccountModel> investorBanks) { CreateInvestor strategy; var metadata = ExecuteSync(out strategy, null, underwriterID, underwriterID, investor, investorContacts, investorBanks); return(new IntActionResult { MetaData = metadata, Value = strategy.InvestorID }); }
public BoolActionResult ManageInvestorDetails(int underwriterID, InvestorModel investorDetails) { ManageInvestorDetails strategy; var metadata = ExecuteSync(out strategy, null, underwriterID, investorDetails); return(new BoolActionResult { MetaData = metadata, Value = strategy.Result }); }
public ManageInvestorDetails(InvestorModel investor) { this.Investor = investor; } //ctor
public void UpdateInvestor(InvestorModel investor) { var id = dbzoho.tbl_CheckID.FirstOrDefault(p => p.EmailMS == investor.UserName); ZCRMRestClient.Initialize(config); ZohoOAuthClient client = ZohoOAuthClient.GetInstance(); string refreshToken = "1000.354c162c19b5da4fc4053bc4e38dd27f.1e548f961cc913acbacd82fbad0a3387"; string userMailId = "*****@*****.**"; ZohoOAuthTokens tokens = client.GenerateAccessTokenFromRefreshToken(refreshToken, userMailId); List <ZCRMRecord> records = new List <ZCRMRecord>(); ZCRMRecord record1 = new ZCRMRecord("accounts"); //module api name record1.EntityId = id.IDZoho; record1.SetFieldValue("id", id.IDZoho); record1.SetFieldValue("Account_Name", investor.UserName); record1.SetFieldValue("Email", investor.UserName); record1.SetFieldValue("Username", investor.UserName); record1.SetFieldValue("Industry", "1"); record1.SetFieldValue("Status", "1"); record1.SetFieldValue("Phone", investor.MobileNumber); record1.SetFieldValue("Fax", investor.MobileNumber); record1.SetFieldValue("Employees", 1); record1.SetFieldValue("Age", investor.Age); record1.SetFieldValue("Gender", investor.Gender); record1.SetFieldValue("NRIC_Number", investor.NRIC_Number); record1.SetFieldValue("Passport_Number", investor.PassportNumber); record1.SetFieldValue("Date_Of_Birth", investor.DateOfBirth.Value); record1.SetFieldValue("Sign_Up_Date", investor.DateCreated.Value.Date.ToString()); record1.SetFieldValue("Total_Invested", investor.TotalInvestedAmount); record1.SetFieldValue("Admin_Verification", investor.AdminVerification); record1.SetFieldValue("Number_Of_Delinquent_Off_Note", investor.numofdelinquent); record1.SetFieldValue("Number_Of_Fully_Paid_Note", investor.NumberOfFullyPaidNotes); record1.SetFieldValue("Number_of_Close_Off_Note", investor.NumOfCloseOff); record1.SetFieldValue("Qualified_Date", investor.QualifiedDate.Value.Date.ToString()); if (investor.LastLogin == null) { investor.LastLogin = investor.DateCreated; } record1.SetFieldValue("Number_Of_Deliquent_Note", investor.numofdelinquent); record1.SetFieldValue("Last_Login", investor.LastLogin.Value.Date.ToString()); record1.SetFieldValue("Sum_of_Number_Invested_Note", investor.NumberOfInvested); record1.SetFieldValue("Current_in_Funding_Amount", investor.CurrentInFunding); record1.SetFieldValue("Sum_of_Ledge_Amount", investor.ActualAmount); record1.SetFieldValue("Total_Amount_Received", investor.TotalAmountReceived); record1.SetFieldValue("Total_Delinquent_Amount", investor.outstandingPI); record1.SetFieldValue("Outstanding_L", investor.outstanding_I); record1.SetFieldValue("Outstanding_P", investor.outstanding_P); record1.SetFieldValue("Principal_Received", investor.PaidP); record1.SetFieldValue("Interest_Received", investor.PaidI); records.Add(record1); ZCRMModule moduleIns = ZCRMModule.GetInstance("accounts"); //module api name BulkAPIResponse <ZCRMRecord> responseIns = moduleIns.UpdateRecords(records); //To call the Update record method Console.WriteLine("HTTP Status Code:" + responseIns.HttpStatusCode); //To get Update record http response code foreach (EntityResponse response in responseIns.BulkEntitiesResponse) { Console.WriteLine("Status:" + response.Status); //To get Update record response status Console.WriteLine("Message:" + response.Message); //To get Update record response message Console.WriteLine("Details:" + response.ResponseJSON); //To get Update record response details ZCRMRecord record11 = (ZCRMRecord)response.Data; Console.WriteLine(record11.EntityId); //To get inserted record id Console.WriteLine(record11.CreatedTime); Console.WriteLine(record11.ModifiedTime); ZCRMUser CreatedBy = record11.CreatedBy; if (CreatedBy != null) { Console.WriteLine(CreatedBy.Id); Console.WriteLine(CreatedBy.FullName); } ZCRMUser ModifiedBy = record1.ModifiedBy; if (ModifiedBy != null) { Console.WriteLine(ModifiedBy.Id); Console.WriteLine(ModifiedBy.FullName); } } }