public async Task <AddResponse> SuaCauHoi(SuaCauHoiRequest r)
        {
            try
            {
                using (IDbConnection dbConnection = _connection)
                {
                    DynamicParameters parameters = new DynamicParameters();
                    parameters.Add("@ID", r.ID, DbType.Int32);
                    parameters.Add("@PhuongAnA", r.PhuongAnA, DbType.String);
                    parameters.Add("@PhuongAnB", r.PhuongAnB, DbType.String);
                    parameters.Add("@PhuongAnC", r.PhuongAnC, DbType.String);
                    parameters.Add("@PhuongAnD", r.PhuongAnD, DbType.String);
                    parameters.Add("@TieuDe", r.TieuDe, DbType.String);
                    parameters.Add("@DapAn", r.DapAn, DbType.String);
                    parameters.Add("@IDNghe ", r.IDNghe, DbType.Int32);
                    parameters.Add("@IDDoc", r.IDDoc, DbType.Int32);
                    parameters.Add("@IDDethi", r.IDDethi, DbType.Int32);
                    parameters.Add("@IDChuDe", r.IDChuDe, DbType.Int32);
                    await dbConnection.ExecuteAsync(Constants.CauHoi_Sua, param : parameters, commandType : CommandType.StoredProcedure);

                    return(new AddResponse
                    {
                        Code = 1
                    });
                }
            }
            catch (Exception ex)
            {
                return(new AddResponse
                {
                    Code = 0,
                    Message = ex.Message
                });
            }
        }
 public async Task <AddResponse> UpdateCauHoi([FromBody] SuaCauHoiRequest request)
 {
     return(await _cauHoiBusiness.Update(request));
 }
示例#3
0
 public async Task <AddResponse> Update(SuaCauHoiRequest r)
 {
     return(await _cauHoiRepository.SuaCauHoi(r));
 }