ปรับ response นาน
This commit is contained in:
parent
6f36f71f60
commit
9ce6c503c3
1 changed files with 44 additions and 29 deletions
|
|
@ -2050,43 +2050,58 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
// 3️⃣ ดึงสรุปคะแนน (sum_exam_info)
|
||||
// ---------------------------
|
||||
dynamic header = null;
|
||||
using (var cmd = _context.Database.GetDbConnection().CreateCommand())
|
||||
if (data.Count == 0)
|
||||
{
|
||||
cmd.CommandTimeout = 0;
|
||||
var sb = new StringBuilder();
|
||||
cmd.Parameters.Clear();
|
||||
sb.Append(" SELECT count, pass, notpass, missed_exam, other FROM sum_exam_info WHERE recruit_import_id = @id ");
|
||||
cmd.Parameters.Add(p_Id);
|
||||
cmd.CommandText = sb.ToString();
|
||||
_context.Database.OpenConnection();
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
header = new
|
||||
{
|
||||
if (!reader.HasRows)
|
||||
count = 0,
|
||||
pass = 0,
|
||||
notpass = 0,
|
||||
missed_exam = 0,
|
||||
other = 0
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var cmd = _context.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
cmd.CommandTimeout = 0;
|
||||
var sb = new StringBuilder();
|
||||
cmd.Parameters.Clear();
|
||||
sb.Append(" SELECT count, pass, notpass, missed_exam, other FROM sum_exam_info WHERE recruit_import_id = @id ");
|
||||
cmd.Parameters.Add(p_Id);
|
||||
cmd.CommandText = sb.ToString();
|
||||
_context.Database.OpenConnection();
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
header = new
|
||||
if (!reader.HasRows)
|
||||
{
|
||||
count = 0,
|
||||
pass = 0,
|
||||
notpass = 0,
|
||||
missed_exam = 0,
|
||||
other = 0
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.Read();
|
||||
header = new
|
||||
header = new
|
||||
{
|
||||
count = 0,
|
||||
pass = 0,
|
||||
notpass = 0,
|
||||
missed_exam = 0,
|
||||
other = 0
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
count = reader["count"].ToString().ToInteger(),
|
||||
pass = reader["pass"].ToString().ToInteger(),
|
||||
notpass = reader["notpass"].ToString().ToInteger(),
|
||||
missed_exam = reader["missed_exam"].ToString().ToInteger(),
|
||||
other = reader["other"].ToString().ToInteger()
|
||||
};
|
||||
reader.Read();
|
||||
header = new
|
||||
{
|
||||
count = reader["count"].ToString().ToInteger(),
|
||||
pass = reader["pass"].ToString().ToInteger(),
|
||||
notpass = reader["notpass"].ToString().ToInteger(),
|
||||
missed_exam = reader["missed_exam"].ToString().ToInteger(),
|
||||
other = reader["other"].ToString().ToInteger()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------
|
||||
// 4️⃣ ดึง period
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue