Пример #1
0
        /// <summary>
        /// 审核教练
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public ApproveCoachResponse ApproveCoach(ApproveCoachRequest request)
        {
            var result = new ApproveCoachResponse()
            {
                ResultMessage = "审核教练成功",
                Result        = ResultCode.Success
            };

            try
            {
                using (var con = new DbConnectionProvider(dbName).GetOpenConnection())
                {
                    var parms = new DynamicParameters();
                    parms.Add("P_CoachApprovalID", request.CoachApprovalID, DbType.Int32);
                    parms.Add("P_ApproveStatus", request.ApproveStatus, DbType.Int32);
                    parms.Add("P_ApproverUserID", 1, DbType.Int32);//TODO

                    result.CoachID = con.ExecuteScalar <int>("sp_ApproveCoach"
                                                             , parms
                                                             , CommandType.StoredProcedure);
                }
            }
            catch (Exception ex)
            {
                result.ResultMessage = "审核教练异常";
                result.Result        = ResultCode.Error;
                result.Errors.Add(ex.Message);
                LogHelper.WriteErrorLog(ex);
            }
            return(result);
        }
Пример #2
0
 public ApproveCoachResponse ApproveCoach(ApproveCoachRequest request)
 {
     return(AdminManager.GetInstance().ApproveCoach(request));
 }