Exemple #1
0
        public void SaveAccountDetails(AccountModel accountModelDetails)
        {
            AccountRepository accountRepository = new AccountRepository();
            AccountDTO accountEntity = new AccountDTO();

            AutoMapper.Mapper.Map(accountModelDetails, accountEntity);
            accountRepository.SaveAccountDetails(accountEntity);
        }
 private AccountDTO PopulateAccountDetails(IDataRecord dataRecord)
 {
     AccountDTO accountDetails = new AccountDTO();
     accountDetails.Id = Convert.ToInt32(dataRecord["Id"]);
     accountDetails.CustomerId = Convert.ToInt32(dataRecord["CustomerId"]);
     accountDetails.CustomerName = Convert.ToString(dataRecord["CustomerName"]);
     accountDetails.BrokAmount = Convert.ToInt32(dataRecord["BrokAmount"]);
     accountDetails.TransAmount = Convert.ToInt32(dataRecord["TransAmount"]);
     accountDetails.Interest = Convert.ToInt32(dataRecord["Interest"]);
     accountDetails.GainLost = Convert.ToInt32(dataRecord["GainLost"]);
     accountDetails.Balance = Convert.ToInt32(dataRecord["Balance"]);
     return accountDetails;
 }
        public void SaveAccountDetails(AccountDTO accountEntity)
        {
            SqlParameter[] _sqlParams = new SqlParameter[]
            {
                new SqlParameter("@AccountId", accountEntity.Id),
                new SqlParameter("@CustomerId", accountEntity.CustomerId),
                new SqlParameter("@BrokAmount", accountEntity.BrokAmount),
                new SqlParameter("@TransAmount", accountEntity.TransAmount),
                new SqlParameter("@Interest", accountEntity.Interest),
                new SqlParameter("@GainLost", accountEntity.GainLost),
                new SqlParameter("@Balance", accountEntity.Balance)
            };

            SqlHelper.ExecuteNonQuery(ConnectionClass.OpenConnection(), CommandType.StoredProcedure,
                 AppConstants.SAVEORUPDATEACCOUNTS, _sqlParams);
        }