Beispiel #1
0
        public int CreateUnidentified(string ledgerType, UnidentifiedDTO unidentifiedDTO)
        {
            int result;
            IDataManager manager = SqlDataManager.UniqueInstance;

            IList<SqlParameter> parameters = new List<SqlParameter>();
            parameters = AddSqlParameter(parameters, "@ContractKey", unidentifiedDTO.InsurerContractKey.ToString(),
                                         SqlDbType.Int, "in");
            parameters = AddSqlParameter(parameters, "@ClaimID", unidentifiedDTO.Reference, SqlDbType.VarChar, "in");
            parameters = AddSqlParameter(parameters, "@ChkAmt", unidentifiedDTO.Amount.ToString(), SqlDbType.Money, "in");
            parameters = AddSqlParameter(parameters, "@OpenCr", unidentifiedDTO.IsOpenCredit.ToString(), SqlDbType.Bit,
                                         "in");
            parameters = AddSqlParameter(parameters, "@UserAdded", unidentifiedDTO.UserAdded, SqlDbType.VarChar, "in");

            ExecuteOutcome outcome;
            string outcomeMessage;

            if (ledgerType == "PayerAccountsReceivable")
            {
                result = (int) manager.Execute(
                                   TransactionChoice.WithoutTransaction
                                   , CommandType.StoredProcedure
                                   , "corBulkPosting_InsUnidentifiedINS"
                                   , ExecuteType.ExecuteScaler
                                   , parameters
                                   , out outcome, out outcomeMessage);
            }
            else
            {
                throw new Exception("Invalid Ledger Type");
            }

            EvaluateOutcome( outcome, outcomeMessage, "CreateUnidentified");

            return result;
        }
Beispiel #2
0
        /// <summary>
        /// Create an unidentifed record
        /// </summary>
        /// <param name="ledgerType"></param>
        /// <param name="unidentified"></param>
        /// <returns></returns>
        private int CreateUnidentified(string ledgerType, IUnidentifiedMoney unidentified)
        {
            // ReSharper disable RedundantAssignment
            int result = 0;
            // ReSharper restore RedundantAssignment
            UnidentifiedDTO unidentifiedDTO = new UnidentifiedDTO(unidentified.ContractKey
                , unidentified.Reference, unidentified.Amount, unidentified.IsOpenCredit, _batchHeaderDTO.UserAdded);

            result = _dataAccess.CreateUnidentified(ledgerType
              , unidentifiedDTO);

            return result;
        }