コード例 #1
0
        public async Task <UnsettleTxn> GetUnsettleTxnDetail(string TxnId)
        {
            var objDataEngine = new FleetDataEngine(AccessMode.CustomerService, DBType.Maint);


            try
            {
                objDataEngine.InitiateConnection();
                SqlParameter[] Parameters = new SqlParameter[2];
                Parameters[0] = new SqlParameter("@IssNo", GetIssNo);
                Parameters[1] = String.IsNullOrEmpty(TxnId) ? new SqlParameter("@TxnId", DBNull.Value) : new SqlParameter("@TxnId", TxnId);
                var execResult = await objDataEngine.ExecuteCommandAsync("WebTxnUnsettleSelect", CommandType.StoredProcedure, Parameters);

                var UnsettleTxnDetail = new UnsettleTxn();

                while (execResult.Read())
                {
                    UnsettleTxnDetail = new UnsettleTxn
                    {
                        TxnId        = Convert.ToString(execResult["TxnId"]),
                        BatchId      = Convert.ToString(execResult["BatchId"]),
                        RecType      = Convert.ToString(execResult["RecType"]),
                        AcctNo       = Convert.ToString(execResult["AcctNo"]),
                        TxnCd        = ConvertInt(execResult["TxnCd"]),
                        CheqNo       = Convert.ToString(execResult["ChqNo"]),
                        PayeeName    = Convert.ToString(execResult["PayeeName"]),
                        TxnDate      = DateConverter(execResult["TxnDate"]),
                        STxnAmt      = ConverterDecimal(execResult["TxnAmt"]),
                        Descp        = Convert.ToString(execResult["Descp"]),
                        SelectedSts  = Convert.ToString(execResult["Sts"]),
                        creationDate = DateConverter(execResult["CreationDate"]),
                        LastUpdDate  = DateConverter(execResult["LastUpdDate"]),
                        UserId       = Convert.ToString(execResult["UserId"]),
                    };
                }
                ;
                return(UnsettleTxnDetail);
            }
            finally
            {
                objDataEngine.CloseConnection();
            }
        }
コード例 #2
0
        public async Task <MsgRetriever> SaveUnsettleTxn(UnsettleTxn _ust)
        {
            var objDataEngine = new FleetDataEngine(AccessMode.CustomerService, DBType.Maint);

            try
            {
                objDataEngine.InitiateConnection();
                SqlParameter[] Parameters = new SqlParameter[14];
                Parameters[0] = new SqlParameter("@IssNo", GetIssNo);
                Parameters[1] = String.IsNullOrEmpty(_ust.TxnId) ? new SqlParameter("@TxnId", DBNull.Value) : new SqlParameter("@TxnId", _ust.TxnId);
                Parameters[2] = String.IsNullOrEmpty(_ust.AcctNo) ? new SqlParameter("@AcctNo", DBNull.Value) : new SqlParameter("@AcctNo", _ust.AcctNo);

                Parameters[3] = new SqlParameter("@TxnCd", ConvertIntToDb(_ust.TxnCd));
                Parameters[4] = String.IsNullOrEmpty(_ust.TxnDate) ? new SqlParameter("@TxnDate", DBNull.Value) : new SqlParameter("@TxnDate", DateConverterDB(_ust.TxnDate));
                Parameters[5] = String.IsNullOrEmpty(_ust.BookingDate) ? new SqlParameter("@BookingDate", DBNull.Value) : new SqlParameter("@BookingDate", DateConverterDB(_ust.BookingDate));
                Parameters[6] = new SqlParameter("@TxnAmt", ConvertDecimalToDb(_ust.STxnAmt));
                Parameters[7] = String.IsNullOrEmpty(_ust.Descp) ? new SqlParameter("@Descp", DBNull.Value) : new SqlParameter("@Descp", _ust.Descp);
                //      Parameters[8] = String.IsNullOrEmpty(_ust.PayeeName) ? new SqlParameter("@PayeeName ", DBNull.Value) : new SqlParameter("@PayeeName", _ust.PayeeName);
                Parameters[8]            = String.IsNullOrEmpty(_ust.CheqNo) ? new SqlParameter("@CheqNo", DBNull.Value) : new SqlParameter("@CheqNo", _ust.CheqNo);
                Parameters[9]            = String.IsNullOrEmpty(_ust.SelectedSts) ? new SqlParameter("@Sts", DBNull.Value) : new SqlParameter("@Sts", _ust.SelectedSts);
                Parameters[10]           = new SqlParameter("@RcptNo", SqlDbType.BigInt);
                Parameters[10].Direction = ParameterDirection.Output;
                Parameters[11]           = new SqlParameter("@RetCd", SqlDbType.BigInt);
                Parameters[11].Direction = ParameterDirection.Output;
                Parameters[12]           = new SqlParameter("@UserId", this.GetUserId);
                Parameters[13]           = new SqlParameter("@RETURN_VALUE", SqlDbType.BigInt);
                Parameters[13].Direction = ParameterDirection.ReturnValue;

                var Cmd    = objDataEngine.ExecuteWithReturnValue("WebTxnUnsettleMaint", CommandType.StoredProcedure, Parameters);
                var Result = Convert.ToInt32(Cmd.Parameters["@RETURN_VALUE"].Value);
                var Descp  = GetMessageCode(Result);
                return(await Descp);
            }
            finally
            {
                objDataEngine.CloseConnection();
            }
        }
コード例 #3
0
        public async Task <ActionResult> SaveUnsettleTxn(UnsettleTxn _ust)
        {
            var _saveTxn = await objUnallocatedTxn.SaveUnsettleTxn(_ust);

            return(Json(new { result = _saveTxn }, JsonRequestBehavior.AllowGet));
        }