docs: #319 restoring the ability to break a section from 4 places

This commit is contained in:
Hamid Reza Mohammadi 2022-05-20 08:40:52 +04:30
parent 8b65c04a51
commit 83ba58fb6e
3 changed files with 52 additions and 5 deletions

View File

@ -34,8 +34,8 @@ else
}
}
if (breakFromVIndices.length > 1) {
alert('حداکثر از ۱ محل می‌توانید قطعه را بشکنید.');
if (breakFromVIndices.length > 4) {
alert('حداکثر از ۴ محل می‌توانید قطعه را بشکنید.');
return;
}

View File

@ -25,8 +25,8 @@ else
}
}
if (breakFromVIndices.length > 1) {
alert('حداکثر از ۱ محل می‌توانید قطعه را بشکنید.');
if (breakFromVIndices.length > 4) {
alert('حداکثر از ۴ محل می‌توانید قطعه را بشکنید.');
return;
}

View File

@ -90,6 +90,54 @@ namespace RMuseum.Services.Implementation
}
}
if (dbCorrection.BreakFromVerse4VOrder != null)
{
if (moderation.BreakFromVerse4VOrder != dbCorrection.BreakFromVerse4VOrder)
{
dbCorrection.BreakFromVerse4VOrderResult = CorrectionReviewResult.RejectedBecauseWrong;
dbCorrection.BreakFromVerse4VOrder = null;
}
else
{
await _BreakSection(sections, editingSectionNotTracked, (int)dbCorrection.BreakFromVerse4VOrder);
dbCorrection.BreakFromVerse4VOrderResult = CorrectionReviewResult.Approved;
_context.GanjoorPoemSectionCorrections.Update(dbCorrection);
await _context.SaveChangesAsync();
}
}
if (dbCorrection.BreakFromVerse3VOrder != null)
{
if (moderation.BreakFromVerse3VOrder != dbCorrection.BreakFromVerse3VOrder)
{
dbCorrection.BreakFromVerse3VOrderResult = CorrectionReviewResult.RejectedBecauseWrong;
dbCorrection.BreakFromVerse3VOrder = null;
}
else
{
await _BreakSection(sections, editingSectionNotTracked, (int)dbCorrection.BreakFromVerse3VOrder);
dbCorrection.BreakFromVerse3VOrderResult = CorrectionReviewResult.Approved;
_context.GanjoorPoemSectionCorrections.Update(dbCorrection);
await _context.SaveChangesAsync();
}
}
if (dbCorrection.BreakFromVerse2VOrder != null)
{
if (moderation.BreakFromVerse2VOrder != dbCorrection.BreakFromVerse2VOrder)
{
dbCorrection.BreakFromVerse2VOrderResult = CorrectionReviewResult.RejectedBecauseWrong;
dbCorrection.BreakFromVerse2VOrder = null;
}
else
{
await _BreakSection(sections, editingSectionNotTracked, (int)dbCorrection.BreakFromVerse2VOrder);
dbCorrection.BreakFromVerse2VOrderResult = CorrectionReviewResult.Approved;
_context.GanjoorPoemSectionCorrections.Update(dbCorrection);
await _context.SaveChangesAsync();
}
}
if (dbCorrection.BreakFromVerse1VOrder != null)
{
if (moderation.BreakFromVerse1VOrder != dbCorrection.BreakFromVerse1VOrder)
@ -105,7 +153,6 @@ namespace RMuseum.Services.Implementation
await _context.SaveChangesAsync();
}
}
_context.GanjoorPoemSectionCorrections.Update(dbCorrection);
await _context.SaveChangesAsync();