public async Task <APIResult> SaveItemApproalYN(ItemApproalParams param)
        {
            try
            {
                string spName = @"up_RMMT_TOU_ItemApproalYN_C";

                DynamicParameters dp = new DynamicParameters();
                dp.Add("@TPId", param.TPId, DbType.Int64);
                dp.Add("@TIId", param.TIId, DbType.Int64);
                dp.Add("@Score", param.Score, DbType.Int64);
                dp.Add("@PlanApproalYN", param.PlanApproalYN, DbType.Boolean);
                dp.Add("@ResultApproalYN", param.ResultApproalYN, DbType.Boolean);
                dp.Add("@UserId", param.UserId, DbType.Int64);

                using (var conn = new SqlConnection(DapperContext.Current.SqlConnection))
                {
                    conn.Open();
                    using (var tran = conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted))
                    {
                        await conn.ExecuteAsync(spName, dp, tran, null, CommandType.StoredProcedure);

                        tran.Commit();
                    }
                }
                return(new APIResult {
                    Body = "", ResultCode = ResultType.Success, Msg = ""
                });
            }
            catch (Exception ex)
            {
                return(new APIResult {
                    Body = "", ResultCode = ResultType.Failure, Msg = ex.Message
                });
            }
        }
Exemplo n.º 2
0
 public Task <APIResult> SaveItemApproalYN([FromBody] ItemApproalParams param)
 {
     return(_tourService.SaveItemApproalYN(param));
 }