Ejemplo n.º 1
0
        public int SaveAgentBankInfo(AgentBankModel modelTosave, int agentid)
        {
            AgentBanks datamodel = new AgentBanks
            {
                AgentId           = agentid,
                BankId            = modelTosave.BankId,
                BankBranchId      = modelTosave.BankBranchId,
                BankAccountTypeId = modelTosave.BankAccountTypeId,
                AccountName       = modelTosave.AccountName,
                AccountNumber     = modelTosave.AccountNumber,
                isDefault         = false,
            };

            db.AddToAgentBanks(datamodel);
            db.SaveChanges();
            int lastid = GetLastAgentBankId().ToList().Last().AgentBankId;

            return(lastid);
        }