Merge branch 'develop' into working
# Conflicts: # BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs
This commit is contained in:
commit
37d9a5d7f5
61 changed files with 74888 additions and 80 deletions
|
|
@ -130,7 +130,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
var disciplineComplaintDocs = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineComplaintDocs)
|
||||
|
|
@ -242,9 +242,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
{
|
||||
var data = await _context.DisciplineComplaints.Include(x => x.DisciplineComplaint_Profiles).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
data.RespondentType = req.respondentType.Trim().ToUpper();
|
||||
data.Organization = req.organizationId;
|
||||
|
|
@ -310,7 +310,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
_context.DisciplineComplaints.Remove(data);
|
||||
// var _docId = data.Document.Id;
|
||||
// await _context.SaveChangesAsync();
|
||||
|
|
@ -334,9 +334,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), StatusCodes.Status500InternalServerError);
|
||||
data.Status = "STOP";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -362,9 +362,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), StatusCodes.Status500InternalServerError);
|
||||
data.Status = "SEND_INVESTIGATE";
|
||||
|
||||
var disciplineInvestigate = new Domain.Models.Discipline.DisciplineInvestigate
|
||||
|
|
@ -450,9 +450,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "STOP")
|
||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), StatusCodes.Status500InternalServerError);
|
||||
data.Status = "NEW";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -474,9 +474,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
|
|
@ -524,9 +524,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
var dataDoc = data.DisciplineComplaint_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace BMA.EHR.DisciplineComplaint_Channel.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
return Success(data);
|
||||
}
|
||||
|
||||
|
|
@ -133,11 +133,11 @@ namespace BMA.EHR.DisciplineComplaint_Channel.Service.Controllers
|
|||
{
|
||||
var data = await _context.DisciplineComplaint_Channels.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
var dupicateData = await _context.DisciplineComplaint_Channels.Where(x => x.Id != id && x.Name == req.name).FirstOrDefaultAsync();
|
||||
if (dupicateData != null)
|
||||
return Error(new Exception("ชื่อประเภทนี้มีอยู่ในระบบแล้ว"), (int)StatusCodes.Status400BadRequest);
|
||||
return Error(new Exception("ชื่อประเภทนี้มีอยู่ในระบบแล้ว"), StatusCodes.Status400BadRequest);
|
||||
|
||||
data.Name = req.name;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
|
|
@ -160,7 +160,7 @@ namespace BMA.EHR.DisciplineComplaint_Channel.Service.Controllers
|
|||
{
|
||||
var data = await _context.DisciplineComplaint_Channels.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
_context.DisciplineComplaint_Channels.Remove(data);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
return Success(data);
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
|||
{
|
||||
var data = await _context.DisciplineDirectors.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
data.Prefix = req.prefix;
|
||||
data.FirstName = req.firstName;
|
||||
|
|
@ -181,7 +181,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
|||
{
|
||||
var data = await _context.DisciplineDirectors.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
_context.DisciplineDirectors.Remove(data);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
var disciplineInvestigateDocComplaints = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineInvestigateDocComplaints)
|
||||
|
|
@ -179,9 +179,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
{
|
||||
var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_ProfileComplaints).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
data.Title = req.title;
|
||||
data.Description = req.description;
|
||||
|
|
@ -282,7 +282,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
var disciplineInvestigateDocs = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineInvestigateDocs)
|
||||
|
|
@ -347,9 +347,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
||||
data.InvestigationDetailOther = req.investigationDetailOther;
|
||||
|
|
@ -432,11 +432,11 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), StatusCodes.Status500InternalServerError);
|
||||
if (data.InvestigationStatusResult == null || data.InvestigationStatusResult.Trim().ToUpper() != "NO_CAUSE")
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), StatusCodes.Status500InternalServerError);
|
||||
data.Status = "STOP";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -467,7 +467,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถส่งต่อไปสอบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "SEND_DISCIPLINARY";
|
||||
|
|
@ -609,9 +609,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "STOP")
|
||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), StatusCodes.Status500InternalServerError);
|
||||
data.Status = "NEW";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -633,9 +633,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
|
|
@ -683,9 +683,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
var dataDoc = data.DisciplineInvestigate_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
|
|
@ -716,9 +716,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
|
|
@ -769,9 +769,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
var dataDoc = data.DisciplineInvestigate_DocComplaints.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
|
|
@ -806,9 +806,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
|
|
@ -856,9 +856,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||
var dataDoc = data.DisciplineInvestigateRelevant_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue