コード例 #1
0
        public bool Disapprove_GLFee(GLFeeRepo GLFee)
        {
            var app = new AppSettings();

            // get the pending purchase record

            GLFee.GetGLFeePendingList(TID);

            TransactionOptions tsOp = new TransactionOptions();

            tsOp.IsolationLevel = System.Transactions.IsolationLevel.Snapshot;
            TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew, tsOp);

            tsOp.Timeout = TimeSpan.FromMinutes(20);

            using (OracleConnection conn = new OracleConnection(app.conString()))  //
            {
                try
                {
                    // UPDATE log TABLE

                    DynamicParameters param = new DynamicParameters();
                    param.Add(name: "P_TID", value: TID, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param.Add(name: "P_REC_STATUS", value: "DISAPPROVED", dbType: DbType.String, direction: ParameterDirection.Input);
                    conn.Execute("APP_GLFEE", param, commandType: CommandType.StoredProcedure);


                    ts.Complete();

                    return(true);
                }
                catch (Exception ex)
                {
                    string xx = ex.ToString();
                    throw;
                }
                finally
                {
                    ts.Dispose();
                    if (conn.State == ConnectionState.Open)
                    {
                        conn.Close();
                    }
                }
            }
        }
コード例 #2
0
        public bool Approve_GLFee(GLFeeRepo GLFee)
        {
            var app = new AppSettings();

            // get the pending purchase record

            GLFee.GetGLFeePendingList(TID);

            TransactionOptions tsOp = new TransactionOptions();

            tsOp.IsolationLevel = System.Transactions.IsolationLevel.Snapshot;
            TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew, tsOp);

            tsOp.Timeout = TimeSpan.FromMinutes(20);

            using (OracleConnection conn = new OracleConnection(app.conString()))  //
            {
                try
                {
                    // UPDATE log TABLE

                    DynamicParameters param = new DynamicParameters();
                    param.Add(name: "P_TID", value: TID, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param.Add(name: "P_REC_STATUS", value: "ACTIVE", dbType: DbType.String, direction: ParameterDirection.Input);
                    conn.Execute("APP_GLFEE", param, commandType: CommandType.StoredProcedure);

                    //UPDATE GL_ACCOUNT TABLE AND GL_TRANSACTION TABLE

                    DynamicParameters param_gl = new DynamicParameters();
                    param_gl.Add(name: "P_GL_NO", value: GLFee.GL_Account_No, dbType: DbType.String, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_AMOUNT", value: GLFee.Paid_Amount, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_NARRATION", value: GLFee.Narration, dbType: DbType.String, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_TID", value: GLFee.TID, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_AUTH_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_TRANS_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.DateTime, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_SF_ID", value: GLFee.Scheme_Fund_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_FEE_ID", value: GLFee.Fee_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                    param_gl.Add(name: "P_FM_ID", value: GLFee.Fund_Manager_Id, dbType: DbType.String, direction: ParameterDirection.Input);

                    conn.Execute("APP_FEE_GL_TRANS", param_gl, commandType: CommandType.StoredProcedure);



                    ts.Complete();

                    return(true);
                }
                catch (Exception ex)
                {
                    string xx = ex.ToString();
                    throw;
                }
                finally
                {
                    ts.Dispose();
                    if (con.State == ConnectionState.Open)
                    {
                        conn.Close();
                    }
                }
            }
        }