Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f3562fb73 | ||
|
|
bc977af15c | ||
|
|
6be6bc533c | ||
|
|
864c76f827 | ||
|
|
8208b31d08 | ||
|
|
4f149f4eef | ||
|
|
8ce7268338 | ||
|
|
d42900e8f6 | ||
|
|
25cd092a08 | ||
|
|
e5dd9aad27 | ||
|
|
d1ad7e76c3 | ||
|
|
5e94586a75 | ||
|
|
d775ae82a0 | ||
|
|
e6b53d193c | ||
|
|
400a459479 | ||
|
|
ac74ef9cfc | ||
|
|
4c7d71a404 | ||
|
|
75d8119880 | ||
|
|
ff9d6ae361 | ||
|
|
6839fc0b78 | ||
|
|
11aea1eb5d | ||
|
|
fb58bfcde0 | ||
|
|
7be3a5c58a | ||
|
|
d3e63404a2 | ||
|
|
cd0b1da85b | ||
|
|
dc12fe8709 | ||
|
|
92dcb645db | ||
|
|
0d83e30cd2 | ||
|
|
2318269f99 | ||
|
|
84f161585a | ||
|
|
05259a09ee | ||
|
|
98442dfe90 | ||
|
|
e745f313a8 | ||
|
|
254ab86d03 | ||
|
|
4c25dd2105 | ||
|
|
da92dc45b6 | ||
|
|
e8f7ee7e36 | ||
|
|
b6ffcca996 | ||
|
|
0a36544dce | ||
|
|
699110af10 | ||
|
|
272bd1a3fd |
@@ -342,3 +342,5 @@ healthchecksdb
|
||||
/src/WorkFlowCheck.API/Images
|
||||
*.pdf
|
||||
/src/WorkFlowCheck.API/Pdf/c86f3a6a-c646-4627-823c-7e24134b7725.docx
|
||||
/src/WorkFlowCheck.API/Downloads/APK/com.nuvolar.wfcapp-Signed.apk
|
||||
/src/WorkFlowCheck.API/Pdf/3b9fd83a-dce8-4427-813b-9475726700be.docx
|
||||
|
||||
@@ -139,6 +139,7 @@ namespace WorkFlowCheck.API.Controllers
|
||||
{
|
||||
var result = await _checkListService.CloseCheckListHeader(checkListHeaderCloseDTO);
|
||||
retVal.Data = result;
|
||||
retVal.IsSuccess = result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -301,6 +302,28 @@ namespace WorkFlowCheck.API.Controllers
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("CloneCheckListTemplateHeader/{id}")]
|
||||
public async Task<ApiResponseDTO<bool>> CloneCheckListTemplateHeader(int id)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<bool>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var result = await _checkListService.CloneCheckListTemplateHeaderAsync(id);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("GetCheckListTemplateRow/{id}")]
|
||||
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> GetCheckListTemplateRow(int id)
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
using Google.Apis.Auth.OAuth2;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Serilog;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.API.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class FCMController : ControllerBase
|
||||
{
|
||||
private readonly IMessageService _messageService;
|
||||
public FCMController(IMessageService messageService)
|
||||
{
|
||||
_messageService = messageService;
|
||||
}
|
||||
|
||||
[HttpPost("SendFCMMessage")]
|
||||
public async Task<ApiResponseDTO<bool>> SendFCMMessage([FromBody] FCMMessageDTO fCMMessageDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<bool>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
retVal.IsSuccess = await _messageService.SendFCMMessage(fCMMessageDTO);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpPost("SendFCMMessageToLastToken")]
|
||||
public async Task<ApiResponseDTO<bool>> SendFCMMessageToLastToken([FromBody] FCMMessageDTO fCMMessageDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<bool>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
retVal.IsSuccess = await _messageService.SendFCMMessageToLastToken(fCMMessageDTO);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpPost("SendFCMToken")]
|
||||
public async Task<ApiResponseDTO<bool>> SendFCMToken([FromBody] FCMMessageDTO fCMMessageDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<bool>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
await _messageService.SendFCMTokenAsync(fCMMessageDTO.Token);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -17,6 +17,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Apis.Auth" Version="1.69.0" />
|
||||
<PackageReference Include="MailKit" Version="4.11.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.12">
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
||||
//"DefaultConnection": "Data Source=NSINB-37\\WFC;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
||||
//"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False",
|
||||
"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFCUAT;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "service_account",
|
||||
"project_id": "com-nuvolar-wfcapp",
|
||||
"private_key_id": "37642626e4a61fea715f3ef02a35d53fa9227666",
|
||||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVQKzCOgEhaQFo\nxtOYCpOc6XQNOVfNm8Z1xu1uoQtSZZIH3ivJy1IBqlyP/+sQ+7FO3Af5v90ae3rf\nvzd42QC4hrbBPyLGbVJWDHNPOzwg7bbez3waaU4i/7m4YJ61hlOObo888mjAxG8t\nz0cDEQzWPPUlLBCvtzY8Zv3jWdYaBxGUUzHxfemjTVLG7YCUjyt057HJVSH7AJpV\ndhnBi+3xlogsnK227ou/rLWoNyZVDOUaSiMor+LNiQx82eXc+UUaJgjpbI5AMk9z\n7CgAM8CSMOw7BHhCImVXaxH9rLZCsw0xpZnCJuOJKRyIMhrfcWKcHjrgkEW+xErj\nWN9lSkHRAgMBAAECggEAAwH5FUcrVom13b9bfF3ysnPdKwbNvVrLN5yDFIKV7oK1\n3Bca42u3rulIqR15doe275GVLtASL+ZfABcrslGPr1hGIqvvusdRVGL2+CjXveti\nbvgoDmVyvddwzf2S9zIiOQ2i8PHK4P8YZTg/DGmVnFPhRg7utWbMFtClw0UQQKkd\nzRwRDsw0jx9wDpP4EaO+czNvVZnnj+miL8QICN4gjbTdyQiVw2D1KzabwmozfEkM\nqTP+yH9mSC4gAEkG+X3i48QxiXZXvLflfnhF58+mT4yjIBIQbRTi0w9yLWRkcs8n\nmCq/89PZMncpNdCSJqdNOsYXgVaW8OMePxPNER2g4QKBgQDHl47N9AGyukpqEJJK\nR/8u3IwcCjLBb0wk5UxtZyz2JpoyqXoaKw7teqCqhg6lVd8MdIcVITKe0nZ+P29z\nyL+RVC+hGm/OQj6mAVyFEZptMgtQZGA2ThLY4ozZgzTW7uNyChhnUcqTiMCJ0g5g\n05imd6nQFKxI1ZfCsE7qlq6yYQKBgQC/bxKYno/6OT+9TTS+OCYVx9WJ8JCzOqFh\n/S+7qV14Bmml/JmYoSo/umxNOlKu3c7QtjU6caD/r4q/r6RHvvBxMlBu4K+vTEXh\nhFeqYORwTcEkcTDpjAGDekeJsRSxv5bg6QtsW30mtreBBC1/fOAvHD03Tz8GmFsp\nHry7b1WlcQKBgQCrnb51iix3oETh5DPVWQirI4n5hi9UMb24L81CeKepU1Hc4+qQ\nW5uvSHSjizdGpIpwLDYGThA3jeHC9gp/9Qn7DPcTQCcIo984YA1MgfFVmOUvj89G\ngmUkRdA0KuQhNzEsWk/XbvWPW9Op7YrdaLNl15iUyWHGEpo2FeEVRtEZoQKBgF5Z\nM+UcYQGGLa/y2UfXDI43izsM4YQ0JU3SJzBqbLK3FmLEeD8NT3FRRAdb81xT3ZZn\n9xvy3NKnhc6rll/17zMbBSFgg7X19YsMWtiSIIRpDgQT9XNlmWlfXtqx9+0S7B21\nPfgNr0ThUNe5Y2Mt/J+7X0BfQkTR2jwN9h665I9BAoGADx/oQLMXgKGdes4adF1Z\np9miGNsmUgXHdT+CdWkRx5uRd1a5s1Di6sOEUBPyFJ9hYc5ObRuC5q1A24ApASak\n0YCbUV1lqzFI4loXyM5ABqRTRCVGH94PXDAvsRUTTLvRIOliOeOBa8bNGGPlXtFw\nXzrkDjsz71JdNxgvT2Zz7nA=\n-----END PRIVATE KEY-----\n",
|
||||
"client_email": "firebase-adminsdk-fbsvc@com-nuvolar-wfcapp.iam.gserviceaccount.com",
|
||||
"client_id": "109975038898567298706",
|
||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
||||
"token_uri": "https://oauth2.googleapis.com/token",
|
||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40com-nuvolar-wfcapp.iam.gserviceaccount.com",
|
||||
"universe_domain": "googleapis.com"
|
||||
}
|
||||
@@ -41,7 +41,12 @@ namespace WorkFlowCheck.BL.DocumentGenerator
|
||||
// LibreOffice parancssori konverzió
|
||||
ProcessStartInfo startInfo = new ProcessStartInfo
|
||||
{
|
||||
#if !DEBUG
|
||||
FileName = "e:\\LibreOffice\\program\\soffice", // LibreOffice parancs
|
||||
#else
|
||||
//FileName = "c:\\Program Files\\LibreOffice\\program\\soffice", // LibreOffice parancs
|
||||
FileName = "e:\\LibreOffice\\program\\soffice", // LibreOffice parancs
|
||||
#endif
|
||||
Arguments = $"--headless --convert-to pdf \"{tempWordPath}\" --outdir \"{pdfDirectory}",
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false,
|
||||
@@ -169,8 +174,6 @@ namespace WorkFlowCheck.BL.DocumentGenerator
|
||||
body.Append(new Paragraph(new Run(new Break() { Type = BreakValues.Page })));
|
||||
body.Append(table);
|
||||
}
|
||||
|
||||
|
||||
private static Drawing CreateImageDrawing(string relationshipId, long width, long height)
|
||||
{
|
||||
return new Drawing(
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Értesítés jóváhagyásról</title>
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; background-color: #f9f9f9; padding: 20px;">
|
||||
|
||||
<p style="font-size: 18px;">
|
||||
A következő munkafolyamat jóvá lett hagyva:
|
||||
</p>
|
||||
|
||||
<p style="font-size: 28px; font-weight: bold; color: #333; margin-top: 10px;">
|
||||
#DocumentNumber#
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -26,13 +26,16 @@ namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
|
||||
private readonly INumberGeneratorService _numberGeneratorService;
|
||||
private readonly IMessageService _messageService;
|
||||
|
||||
public CheckListService(AppDbContext dbContext,
|
||||
IMapper mapper,
|
||||
INumberGeneratorService numberGeneratorService,
|
||||
IMessageService messageService,
|
||||
IUserService userService) : base(dbContext, mapper)
|
||||
{
|
||||
_numberGeneratorService = numberGeneratorService;
|
||||
_messageService = messageService;
|
||||
}
|
||||
|
||||
public async Task<CheckListHeaderDTO> GetCheckListHeaderAsync(int Id)
|
||||
@@ -111,6 +114,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
CheckListTemplateHeaderId = checkListHeaderDTO.CheckListTemplateHeaderDTO.Id,
|
||||
Description = checkListHeaderDTO.Description,
|
||||
ShortName = checkListHeaderDTO.ShortName,
|
||||
GuidNumber = Guid.NewGuid(),
|
||||
};
|
||||
_dbContext.CheckListHeaders.Add(checkListHeader);
|
||||
@@ -126,7 +130,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
if (checkListHeader != null)
|
||||
{
|
||||
checkListHeader.Description = checkListHeaderDTO.Description;
|
||||
|
||||
checkListHeader.ShortName = checkListHeaderDTO.ShortName;
|
||||
|
||||
await _dbContext.SaveChangesAsync();
|
||||
retVal = _mapper.Map<CheckListHeaderDTO>(checkListHeader);
|
||||
@@ -166,7 +170,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
IsEditable = true,
|
||||
UserId = checkListHeaderNewDTO.UserId,
|
||||
ShortName = "",
|
||||
Description = "",
|
||||
Description = checkListTemplateHeader.Description ?? "",
|
||||
DocumentNumber = documentNumber,
|
||||
GuidNumber = Guid.NewGuid(),
|
||||
IsDeleted = false,
|
||||
@@ -214,6 +218,11 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
try
|
||||
{
|
||||
var user = await _dbContext.Users
|
||||
.Where(w => w.Id == userid)
|
||||
.FirstOrDefaultAsync();
|
||||
if (user == null) return false;
|
||||
|
||||
var checkListHeader = await _dbContext.CheckListHeaders
|
||||
.Where(w => w.Id == id && w.CheckStatus == CheckStatus.Sent)
|
||||
.FirstOrDefaultAsync();
|
||||
@@ -223,7 +232,10 @@ namespace WorkFlowCheck.BL.Services
|
||||
checkListHeader.CheckStatus = CheckStatus.Signed;
|
||||
checkListHeader.IsEditable = false;
|
||||
checkListHeader.AcceptUserId = userid;
|
||||
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap státuszváltozása, jóváhasyás: Ellenőrzés:{id}, Felhasználó:{userid}");
|
||||
|
||||
checkListHeader.DateExecution = DateTime.Now;
|
||||
|
||||
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap státuszváltozása, jóváhagyás: Ellenőrzés:{checkListHeader.DocumentNumber}, Felhasználó: {user.LastName} {user.FirstName}");
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
var pdf = await CreateCheckListHeaderPDFAsync(id);
|
||||
@@ -236,17 +248,60 @@ namespace WorkFlowCheck.BL.Services
|
||||
var filePath = Path.Combine(pdfDirectory, fileName);
|
||||
await File.WriteAllBytesAsync(filePath, pdf);
|
||||
|
||||
await SendMailToAcceptedUser(filePath, checkListHeader, userid);
|
||||
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
retVal = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private async Task SendMailToAcceptedUser(string filePath, CheckListHeader checkListHeader, int userId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var user = _dbContext.Users.Where(W => W.Id == userId).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(user.Email))
|
||||
{
|
||||
var recepients = new List<string>()
|
||||
{
|
||||
user.Email,
|
||||
};
|
||||
|
||||
await _messageService.SendMailAsync(recepients,
|
||||
$"Értesítés folyamat jóváhagyásáról {checkListHeader.DocumentNumber}",
|
||||
GetAcceptCheckListHeaderMessageBody(checkListHeader),
|
||||
filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
private string GetAcceptCheckListHeaderMessageBody(CheckListHeader checkListHeader)
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var resourceName = "WorkFlowCheck.BL.HtmlTemplates.AcceptCheckListHeaderBody.html";
|
||||
|
||||
using var stream = assembly.GetManifestResourceStream(resourceName);
|
||||
if (stream == null)
|
||||
throw new FileNotFoundException($"Nem található a beágyazott erőforrás: {resourceName}");
|
||||
|
||||
using var reader = new StreamReader(stream);
|
||||
var html = reader.ReadToEnd();
|
||||
return html.Replace("#DocumentNumber#", checkListHeader.DocumentNumber);
|
||||
}
|
||||
public async Task<byte[]> CreateCheckListHeaderPDFAsync(int checkListHeaderId)
|
||||
{
|
||||
try
|
||||
@@ -258,8 +313,10 @@ namespace WorkFlowCheck.BL.Services
|
||||
byte[] byteArray = File.ReadAllBytes(Path.Combine(pdfDirectory, "CheckList_Template_V1.docx"));
|
||||
SablonGenerator gen = new SablonGenerator(byteArray);
|
||||
|
||||
gen.SimpleReplace("#description#", checkListHeader.Description);
|
||||
gen.SimpleReplace("#DocumentNumber#", checkListHeader.DocumentNumber);
|
||||
gen.SimpleReplace("#DateExecution#", checkListHeader.DateExecution.ToString("yyyy.MM.dd HH:mm"));
|
||||
|
||||
gen.SimpleReplace("#WorkUser#", $"{checkListHeader.UserDTO?.LastName} {checkListHeader.UserDTO?.FirstName}");
|
||||
gen.SimpleReplace("#AcceptUser#", $"{checkListHeader.AcceptUserDTO?.LastName} {checkListHeader.AcceptUserDTO?.FirstName}");
|
||||
gen.SimpleReplace("#Guid#", checkListHeader.GuidNumber.ToString());
|
||||
@@ -493,6 +550,53 @@ namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
return await DeleteEntityByIdAsync<CheckListTemplateHeader>(id);
|
||||
}
|
||||
public async Task<bool> CloneCheckListTemplateHeaderAsync(int id)
|
||||
{
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var checkListTemplateHeader = await _dbContext.CheckListTemplateHeaders
|
||||
.AsNoTracking()
|
||||
.Include(i => i.CheckListTemplateRows)
|
||||
.Where(w => w.Id == id).FirstOrDefaultAsync();
|
||||
if (checkListTemplateHeader != null)
|
||||
{
|
||||
|
||||
var newCheckListTemplateHeader = new CheckListTemplateHeader()
|
||||
{
|
||||
CheckListTemplateRows = new List<CheckListTemplateRow>(),
|
||||
Description = checkListTemplateHeader.Description,
|
||||
IsDeleted = false,
|
||||
NumberGenerator1Id = checkListTemplateHeader.NumberGenerator1Id,
|
||||
NumberGenerator2Id = checkListTemplateHeader.NumberGenerator2Id,
|
||||
ShortName = $"{checkListTemplateHeader.ShortName} (másolat)",
|
||||
};
|
||||
foreach (var checkListTemplateRow in checkListTemplateHeader.CheckListTemplateRows)
|
||||
{
|
||||
var newCheckListTemplateRow = new CheckListTemplateRow()
|
||||
{
|
||||
AnswerType = checkListTemplateRow.AnswerType,
|
||||
CheckListTemplateHeader = newCheckListTemplateHeader,
|
||||
CheckPointId = checkListTemplateRow.CheckPointId,
|
||||
EquipmentId = checkListTemplateRow.EquipmentId,
|
||||
IsDeleted = false,
|
||||
OperationDescription = checkListTemplateRow.OperationDescription,
|
||||
RowIndex = checkListTemplateRow.RowIndex,
|
||||
};
|
||||
newCheckListTemplateHeader.CheckListTemplateRows.Add(newCheckListTemplateRow);
|
||||
}
|
||||
_dbContext.CheckListTemplateHeaders.Add(newCheckListTemplateHeader);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal = false;
|
||||
Log.ForContext("TAG", "BusinessFlow").Error(ex.Message);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
public async Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id)
|
||||
{
|
||||
var retVal = new CheckListTemplateRowDTO();
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateHeaderAsync();
|
||||
Task<CheckListTemplateHeaderDTO> UpdateCheckListTemplateHeaderAsync(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
|
||||
Task<bool> DeleteCheckListTemplateHeaderAsync(int id);
|
||||
Task<bool> CloneCheckListTemplateHeaderAsync(int id);
|
||||
Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id);
|
||||
Task<bool> DeleteCheckListTemplateRowAsync(int id);
|
||||
Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO);
|
||||
|
||||
@@ -3,11 +3,17 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
{
|
||||
public interface IMessageService
|
||||
{
|
||||
Task<bool> SendMailAsync(List<string> recipients, string subject, string htmlBody);
|
||||
Task<bool> SendMailAsync(List<string> recipients, string subject, string htmlBody, string? attachmentFilePath = null);
|
||||
|
||||
Task<bool> SendFCMTokenAsync(string token);
|
||||
Task<string> GetLastFCMTokensAsync();
|
||||
Task<bool> SendFCMMessage(FCMMessageDTO fCMMessageDTO);
|
||||
Task<bool> SendFCMMessageToLastToken(FCMMessageDTO fCMMessageDTO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,19 +4,31 @@ using MimeKit;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using WorkFlowCheck.BL.Models;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
using Serilog;
|
||||
using WorkFlowCheck.DL.Entities;
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using WorkFlowCheck.DL;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using Google.Apis.Auth.OAuth2;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
public class MessageService : IMessageService
|
||||
public class MessageService : BaseService, IMessageService
|
||||
{
|
||||
private readonly EmailSettings _settings;
|
||||
|
||||
public MessageService(IConfiguration configuration)
|
||||
public MessageService(AppDbContext dbContext,
|
||||
IMapper mapper,
|
||||
IConfiguration configuration) : base(dbContext, mapper)
|
||||
{
|
||||
_settings = configuration.GetSection("EmailSettings").Get<EmailSettings>()!;
|
||||
}
|
||||
|
||||
public async Task<bool> SendMailAsync(List<string> recipients, string subject, string htmlBody)
|
||||
public async Task<bool> SendMailAsync(List<string> recipients, string subject, string htmlBody, string? attachmentFilePath = null)
|
||||
{
|
||||
var message = new MimeMessage();
|
||||
message.From.Add(new MailboxAddress(_settings.SenderName, _settings.Username));
|
||||
@@ -28,11 +40,17 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
message.Subject = subject;
|
||||
|
||||
message.Body = new TextPart("html")
|
||||
var builder = new BodyBuilder
|
||||
{
|
||||
Text = htmlBody
|
||||
HtmlBody = htmlBody
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(attachmentFilePath) && File.Exists(attachmentFilePath))
|
||||
{
|
||||
builder.Attachments.Add(attachmentFilePath);
|
||||
}
|
||||
|
||||
message.Body = builder.ToMessageBody();
|
||||
using var smtp = new SmtpClient();
|
||||
await smtp.ConnectAsync(_settings.SmtpServer, _settings.SmtpPort, SecureSocketOptions.StartTls);
|
||||
await smtp.AuthenticateAsync(_settings.Username, _settings.Password);
|
||||
@@ -41,6 +59,126 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
return true;
|
||||
}
|
||||
public async Task<bool> SendFCMTokenAsync(string token)
|
||||
{
|
||||
var retVal = true;
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
|
||||
var FCMToken = await _dbContext.FCMTokens.Where(w => w.Token == token).FirstOrDefaultAsync();
|
||||
if (FCMToken == null)
|
||||
{
|
||||
FCMToken = new FCMToken();
|
||||
FCMToken.Token = token;
|
||||
await _dbContext.FCMTokens.AddAsync(FCMToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
FCMToken.LastModAt = DateTime.UtcNow;
|
||||
}
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal = false;
|
||||
Log.ForContext("TAG", "BusinessFlow").Error(ex.Message);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
public async Task<string> GetLastFCMTokensAsync()
|
||||
{
|
||||
var retVal = "";
|
||||
try
|
||||
{
|
||||
var FCMToken = await _dbContext.FCMTokens
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.LastModAt)
|
||||
.Take(1)
|
||||
.FirstOrDefaultAsync();
|
||||
if (FCMToken != null && !string.IsNullOrEmpty(FCMToken.Token))
|
||||
{
|
||||
retVal += FCMToken.Token;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal = "";
|
||||
Log.ForContext("TAG", "BusinessFlow").Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> SendFCMMessage(FCMMessageDTO fCMMessageDTO)
|
||||
{
|
||||
var retVal = true;
|
||||
try
|
||||
{
|
||||
var pathToJsonKey = "com-nuvolar-wfcapp-firebase-adminsdk-fbsvc-37642626e4.json";
|
||||
var projectId = "com-nuvolar-wfcapp";
|
||||
var credential = GoogleCredential
|
||||
.FromFile(pathToJsonKey)
|
||||
.CreateScoped("https://www.googleapis.com/auth/firebase.messaging");
|
||||
var accessToken = await credential.UnderlyingCredential.GetAccessTokenForRequestAsync();
|
||||
|
||||
var client = new HttpClient();
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
|
||||
|
||||
|
||||
var message = new
|
||||
{
|
||||
message = new
|
||||
{
|
||||
token = fCMMessageDTO.Token,
|
||||
notification = new
|
||||
{
|
||||
title = fCMMessageDTO.Title,
|
||||
body = fCMMessageDTO.Body,
|
||||
},
|
||||
android = new
|
||||
{
|
||||
notification = new
|
||||
{
|
||||
channel_id = "com.nuvolar.wfcapp.general"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var json = JsonConvert.SerializeObject(message);
|
||||
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
|
||||
var response = await client.PostAsync($"https://fcm.googleapis.com/v1/projects/{projectId}/messages:send", content);
|
||||
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> SendFCMMessageToLastToken(FCMMessageDTO fCMMessageDTO)
|
||||
{
|
||||
var retVal = true;
|
||||
try
|
||||
{
|
||||
fCMMessageDTO.Token = await GetLastFCMTokensAsync();
|
||||
|
||||
retVal = await SendFCMMessage(fCMMessageDTO);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,15 +19,17 @@ namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
private readonly IRequestContext _requestContext;
|
||||
private readonly IUserService _userService;
|
||||
|
||||
private readonly IMessageService _messageService;
|
||||
|
||||
public SyncService(AppDbContext dbContext,
|
||||
IMapper mapper,
|
||||
IRequestContext requestContext,
|
||||
IMessageService messageService,
|
||||
IUserService userService) : base(dbContext, mapper)
|
||||
{
|
||||
_requestContext = requestContext;
|
||||
_userService = userService;
|
||||
_messageService = messageService;
|
||||
}
|
||||
|
||||
public async Task<List<CheckPointDTO>> GetAllCheckPointAsync()
|
||||
@@ -210,8 +212,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
var res = await _dbContext.Locations.Where(w => w.Id == LocationDTO.Id).FirstOrDefaultAsync();
|
||||
if (res != null)
|
||||
{
|
||||
res = _mapper.Map<DL.Entities.Location>(LocationDTO);
|
||||
|
||||
res.FullName = LocationDTO.FullName;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
retVal = _mapper.Map<LocationDTO>(res);
|
||||
@@ -347,9 +348,10 @@ namespace WorkFlowCheck.BL.Services
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckListHeaders
|
||||
.Where(w => (w.IsEditable &&
|
||||
w.IsDeleted != true) || (w.CheckStatus == CheckStatus.Blocked)
|
||||
)
|
||||
.Where(w => w.CheckStatus == CheckStatus.Open ||
|
||||
w.CheckStatus == CheckStatus.InProgress ||
|
||||
w.CheckStatus == CheckStatus.Blocked ||
|
||||
w.CheckStatus == CheckStatus.Sent)
|
||||
.Include(i => i.CheckListRows)
|
||||
//.ThenInclude(i => i.CheckListTemplateRow)
|
||||
.AsNoTracking()
|
||||
@@ -383,35 +385,6 @@ namespace WorkFlowCheck.BL.Services
|
||||
if (res != null && (res.CheckStatus == CheckStatus.Open ||
|
||||
res.CheckStatus == CheckStatus.InProgress))
|
||||
{
|
||||
if (NeedBlocking(checkListHeaderDTO))
|
||||
{
|
||||
/// TODO: blokkolás miatt
|
||||
res.CheckStatus = CheckStatus.Blocked;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap blokkolva: Ellenőrzés:{checkListHeaderDTO.Id}, Felhasználó:{_requestContext.CurrentUsername}");
|
||||
|
||||
var user = await _userService.GetUserAsync(_requestContext.CurrentUserId ?? 1);
|
||||
|
||||
foreach (var item in user.RoleDTO)
|
||||
{
|
||||
var deviceMessageDTO = new DeviceMessageDTO()
|
||||
{
|
||||
IsReaded = false,
|
||||
Message = "Ellenőrző lap blokkolva!",
|
||||
SendDate = DateTime.UtcNow,
|
||||
ExtraDataJSON = "",
|
||||
RoleId = item.ParentId,
|
||||
DeviceIdFrom = "",
|
||||
DeviceIdTo = "",
|
||||
};
|
||||
|
||||
await this.DeviceMessageSend(deviceMessageDTO);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
res.CheckStatus = CheckStatus.InProgress;
|
||||
var ids = checkListHeaderDTO.CheckListRowDTO?.Select(r => r.Id).ToList();
|
||||
if (ids != null && ids.Count > 0)
|
||||
{
|
||||
@@ -438,6 +411,47 @@ namespace WorkFlowCheck.BL.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
await _dbContext.SaveChangesAsync();
|
||||
retVal = _mapper.Map<CheckListHeaderDTO>(res);
|
||||
string Answer = "";
|
||||
if (NeedBlocking(checkListHeaderDTO, out Answer))
|
||||
{
|
||||
/// TODO: blokkolás miatt
|
||||
res.CheckStatus = CheckStatus.Blocked;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap blokkolva: Ellenőrzés:{checkListHeaderDTO.Id}, Felhasználó:{_requestContext.CurrentUsername}");
|
||||
|
||||
var user = await _userService.GetUserAsync(_requestContext.CurrentUserId ?? 1);
|
||||
|
||||
foreach (var item in user.RoleDTO)
|
||||
{
|
||||
var deviceMessageDTO = new DeviceMessageDTO()
|
||||
{
|
||||
IsReaded = false,
|
||||
Message = $"Ellenőrző lap blokkolva! [{checkListHeaderDTO.DocumentNumber}]\n({Answer})",
|
||||
SendDate = DateTime.UtcNow,
|
||||
ExtraDataJSON = "",
|
||||
RoleId = item.ParentId,
|
||||
DeviceIdFrom = "",
|
||||
DeviceIdTo = "",
|
||||
};
|
||||
|
||||
await this.DeviceMessageSend(deviceMessageDTO);
|
||||
|
||||
var fCMMessageDTO = new FCMMessageDTO
|
||||
{
|
||||
Body = deviceMessageDTO.Message,
|
||||
Title = "Blokkolási értesítés",
|
||||
UserId = user.Id,
|
||||
};
|
||||
await _messageService.SendFCMMessageToLastToken(fCMMessageDTO);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
res.CheckStatus = CheckStatus.InProgress;
|
||||
|
||||
if (CheckIfLastReached(checkListHeaderDTO))
|
||||
{
|
||||
/// TODO: most kell a CheckStatust állítani és menjen üzenet !
|
||||
@@ -460,9 +474,10 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
return retVal;
|
||||
}
|
||||
private bool NeedBlocking(CheckListHeaderDTO checkListHeaderDTO)
|
||||
private bool NeedBlocking(CheckListHeaderDTO checkListHeaderDTO, out string Answer)
|
||||
{
|
||||
var retVal = false;
|
||||
Answer = "";
|
||||
if (checkListHeaderDTO.CheckListRowDTO != null && checkListHeaderDTO.CheckListRowDTO.Count > 0)
|
||||
{
|
||||
var checkListRows = checkListHeaderDTO.CheckListRowDTO;
|
||||
@@ -472,6 +487,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
if (row.CheckListTemplateRowDTO != null)
|
||||
{
|
||||
Answer = row.CheckListTemplateRowDTO.OperationDescription;
|
||||
if (row.CheckListTemplateRowDTO.AnswerType == "PI-N" && row.Answer == "Igen")
|
||||
{
|
||||
retVal = true;
|
||||
|
||||
@@ -11,12 +11,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="HtmlTemplates\AcceptCheckListHeaderBody.html" />
|
||||
<EmbeddedResource Include="HtmlTemplates\Token2FBody.html" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
|
||||
<PackageReference Include="Google.Apis.Auth" Version="1.69.0" />
|
||||
<PackageReference Include="MailKit" Version="4.11.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
|
||||
<PackageReference Include="Serilog.Expressions" Version="5.0.0" />
|
||||
|
||||
@@ -22,5 +22,7 @@ namespace WorkFlowCheck.Common.DTO
|
||||
|
||||
[DisplayName("Ellenőrzési pontok száma")]
|
||||
public int CheckPointCount { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public int CheckListHeaderId { get; set; }
|
||||
public int CheckListTemplateRowId { get; set; }
|
||||
public CheckListTemplateRowDTO? CheckListTemplateRowDTO { get; set; }
|
||||
public string GroupName => $"AnswerGroup_{CheckListTemplateRowDTO?.RowIndex ?? 0}";
|
||||
public string GroupName => $"AnswerGroup_{CheckListTemplateRowDTO?.Id ?? 0}";
|
||||
|
||||
[DisplayName("Eredmény")]
|
||||
public string Answer { get; set; } = null!;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -9,7 +11,13 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public class EquipmentDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "A megnevezést megadása kötelező.")]
|
||||
[DisplayName("Megnevezés")]
|
||||
public string ShortName { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "Az azonosító megadása kötelező.")]
|
||||
[DisplayName("Azonosító")]
|
||||
public string EquipmentNumber { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.Common.DTO
|
||||
{
|
||||
public class FCMMessageDTO
|
||||
|
||||
{
|
||||
public string? Token { get; set; }
|
||||
public string? Body { get; set; }
|
||||
public string? Title { get; set; }
|
||||
public int? UserId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -9,6 +11,9 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public class LocationDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "A megnevezést megadása kötelező.")]
|
||||
[DisplayName("Megnevezés")]
|
||||
public string FullName { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -10,10 +12,19 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public class RoleCheckListTemplateHeaderDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "A szabály megnevezésének megadása kötelező.")]
|
||||
[DisplayName("Szabály")]
|
||||
public int RoleId { get; set; }
|
||||
public RoleDTO? RoleDTO { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "Az ellenőrzési sablon megadása kötelező.")]
|
||||
[DisplayName("Ellenőrzési sablon")]
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public CheckListTemplateHeaderDTO? CheckListTemplateHeaderDTO { get; set; } = null!;
|
||||
|
||||
|
||||
[DisplayName("Engedélyezve?")]
|
||||
public bool Enabled { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -10,10 +12,18 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public class RoleCheckPointDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "A szabály megadása kötelező.")]
|
||||
[DisplayName("Szabály")]
|
||||
public int RoleId { get; set; }
|
||||
public RoleDTO? RoleDTO { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "Az ellenőrzési pont megadása kötelező.")]
|
||||
[DisplayName("Ellenőrzési pont")]
|
||||
public int CheckPointId { get; set; }
|
||||
public CheckPointDTO? CheckPointDTO { get; set; } = null!;
|
||||
|
||||
[DisplayName("Engedélyezve?")]
|
||||
public bool Enabled { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -16,9 +17,13 @@ namespace WorkFlowCheck.Common.DTO
|
||||
[DisplayName("Régi jelszó")]
|
||||
public string OldPassword { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "A jelszó kötelező.")]
|
||||
[RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{6,}$", ErrorMessage = "Az új jelszónak legalább 6 karakter hosszúnak kell lennie, és tartalmaznia kell kis- és nagybetűt, számot és speciális karaktert.")]
|
||||
[DisplayName("Új jelszó")]
|
||||
public string NewPassword1 { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "A jelszó kötelező.")]
|
||||
[RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{6,}$", ErrorMessage = "Az új jelszónak legalább 6 karakter hosszúnak kell lennie, és tartalmaznia kell kis- és nagybetűt, számot és speciális karaktert.")]
|
||||
[DisplayName("Jelszó megerősítése")]
|
||||
public string NewPassword2 { get; set; } = null!;
|
||||
|
||||
|
||||
@@ -25,8 +25,11 @@ namespace WorkFlowCheck.Common.DTO
|
||||
[DisplayName("Felhasználó neve")]
|
||||
public string UserName { get;set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "A jelszó kötelező.")]
|
||||
[RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{6,}$", ErrorMessage = "A jelszónak legalább 6 karakter hosszúnak kell lennie, és tartalmaznia kell kis- és nagybetűt, számot és speciális karaktert.")]
|
||||
[DisplayName("Jelszó")]
|
||||
public string Password { get; set; }
|
||||
public string Password { get; set; } = null!;
|
||||
|
||||
|
||||
public string JwtToken { get; set; } = null!;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace WorkFlowCheck.DL
|
||||
public DbSet<Entities.CheckPoint> CheckPoints { get; set; } = null!;
|
||||
public DbSet<DeviceMessage> DeviceMessages { get; set; } = null!;
|
||||
public DbSet<Entities.Equipment> Equipments { get; set; } = null!;
|
||||
public DbSet<Entities.FCMToken> FCMTokens { get; set; } = null!;
|
||||
public DbSet<Entities.Location> Locations { get; set; } = null!;
|
||||
public DbSet<Entities.NumberGeneratorTemplate> NumberGeneratorTemplates { get; set; } = null!;
|
||||
public DbSet<Entities.NumberGeneratorTemplateDate> NumberGeneratorTemplateDates { get; set; } = null!;
|
||||
@@ -48,6 +49,7 @@ namespace WorkFlowCheck.DL
|
||||
modelBuilder.ApplyConfiguration(new CheckPointTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new DeviceMessageTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new EquipmentTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new FCMTokenTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new LocationTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new NumberGeneratorTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new NumberGeneratorDateTypeConfiguration());
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.DL.Configurations
|
||||
{
|
||||
public class FCMTokenTypeConfiguration : IEntityTypeConfiguration<Entities.FCMToken>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Entities.FCMToken> builder)
|
||||
{
|
||||
builder.ToTable("FCMToken");
|
||||
builder.HasKey(e => e.Id);
|
||||
builder.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.DL.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.DL.Entities
|
||||
{
|
||||
public class FCMToken:ISoftDeletableEntity, IAuditableEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Token { get; set; } = null!;
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime LastModAt { get; set; }
|
||||
public string LastModBy { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public string CreatedBy { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,997 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using WorkFlowCheck.DL;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20250515123614_Extend021")]
|
||||
partial class Extend021
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.12")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("AcceptUserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CheckListTemplateHeaderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CheckStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateExecution")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DocumentNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("GuidNumber")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsEditable")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsStorno")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AcceptUserId");
|
||||
|
||||
b.HasIndex("CheckListTemplateHeaderId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("CheckListHeader", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("CheckListHeaderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CheckListTemplateRowId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("GuidNumber")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhotoFileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CheckListHeaderId");
|
||||
|
||||
b.HasIndex("CheckListTemplateRowId");
|
||||
|
||||
b.ToTable("CheckListRow", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("NumberGenerator1Id")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("NumberGenerator2Id")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NumberGenerator1Id");
|
||||
|
||||
b.HasIndex("NumberGenerator2Id");
|
||||
|
||||
b.ToTable("CheckListTemplateHeader", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("AnswerType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("CheckListTemplateHeaderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CheckPointId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("EquipmentId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OperationDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("RowIndex")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CheckListTemplateHeaderId");
|
||||
|
||||
b.HasIndex("CheckPointId");
|
||||
|
||||
b.HasIndex("EquipmentId");
|
||||
|
||||
b.ToTable("CheckListTemplateRow", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("RoleId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CheckPoint", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("DeviceIdFrom")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DeviceIdTo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ExtraDataJSON")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsReaded")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("ReceiveDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("RoleId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("SendDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DeviceIdTo")
|
||||
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("DeviceMessage", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EquipmentNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Equipment", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.FCMToken", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Token")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("FCMToken", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Location", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CurrentNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("DigitFormat")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("GenerateType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("LastGeneratedNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Prefix")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PrefixSeparator")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Suffix")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SuffixSeparator")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("NumberGeneratorTemplate", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
CurrentNumber = 0,
|
||||
DigitFormat = "D4",
|
||||
GenerateType = 0,
|
||||
LastGeneratedNumber = "",
|
||||
Prefix = "CHK",
|
||||
PrefixSeparator = "-",
|
||||
ShortName = "Ellenőrzési dokumentum sorszámozása",
|
||||
Suffix = "",
|
||||
SuffixSeparator = "-"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CurrentNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("LastGeneratedNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("Month")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumberGeneratorTemplateId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NumberGeneratorTemplateId");
|
||||
|
||||
b.ToTable("NumberGeneratorTemplateDate", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
CurrentNumber = 0,
|
||||
LastGeneratedNumber = "",
|
||||
Month = 0,
|
||||
NumberGeneratorTemplateId = 1,
|
||||
Year = 1
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("CanDownloadAPK")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CanEnableBlocked")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CanUseMobilApp")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CanUseWebAdmin")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsAdmin")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("ParentId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RoleName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.ToTable("Roles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CheckListTemplateHeaderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("RoleId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CheckListTemplateHeaderId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleCheckListTemplateHeader", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CheckPointId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("RoleId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CheckPointId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleCheckPoint", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("JwtToken")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("NFCActive")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("NFCCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Token2FA")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5079),
|
||||
CreatedBy = "System",
|
||||
Email = "admin@nuvolar.hu",
|
||||
FirstName = "Administrator",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5082),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
NFCActive = true,
|
||||
NFCCode = "00000000",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
|
||||
Token2FA = "",
|
||||
UserName = "admin"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8830),
|
||||
CreatedBy = "System",
|
||||
Email = "user@nuvolar.hu",
|
||||
FirstName = "User",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8834),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
NFCActive = true,
|
||||
NFCCode = "00000000",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
|
||||
Token2FA = "",
|
||||
UserName = "user"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("RoleId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("UserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.User", "AcceptUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("AcceptUserId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
|
||||
.WithMany()
|
||||
.HasForeignKey("CheckListTemplateHeaderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AcceptUser");
|
||||
|
||||
b.Navigation("CheckListTemplateHeader");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
|
||||
.WithMany("CheckListRows")
|
||||
.HasForeignKey("CheckListHeaderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
|
||||
.WithMany()
|
||||
.HasForeignKey("CheckListTemplateRowId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CheckListHeader");
|
||||
|
||||
b.Navigation("CheckListTemplateRow");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
|
||||
.WithMany()
|
||||
.HasForeignKey("NumberGenerator1Id");
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
|
||||
.WithMany()
|
||||
.HasForeignKey("NumberGenerator2Id");
|
||||
|
||||
b.Navigation("NumberGenerator1");
|
||||
|
||||
b.Navigation("NumberGenerator2");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
|
||||
.WithMany("CheckListTemplateRows")
|
||||
.HasForeignKey("CheckListTemplateHeaderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
|
||||
.WithMany("CheckListTemplateRows")
|
||||
.HasForeignKey("CheckPointId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
|
||||
.WithMany()
|
||||
.HasForeignKey("EquipmentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CheckListTemplateHeader");
|
||||
|
||||
b.Navigation("CheckPoint");
|
||||
|
||||
b.Navigation("Equipment");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
|
||||
.WithMany("NumberGeneratorTemplateDates")
|
||||
.HasForeignKey("NumberGeneratorTemplateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("NumberGeneratorTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
|
||||
.WithMany("Children")
|
||||
.HasForeignKey("ParentId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
|
||||
.WithMany()
|
||||
.HasForeignKey("CheckListTemplateHeaderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CheckListTemplateHeader");
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
|
||||
.WithMany()
|
||||
.HasForeignKey("CheckPointId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CheckPoint");
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
|
||||
{
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
|
||||
{
|
||||
b.Navigation("CheckListRows");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
|
||||
{
|
||||
b.Navigation("CheckListTemplateRows");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
|
||||
{
|
||||
b.Navigation("CheckListTemplateRows");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
|
||||
{
|
||||
b.Navigation("NumberGeneratorTemplateDates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Extend021 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FCMToken",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Token = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
LastModAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
LastModBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FCMToken", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5079), new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5082) });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8830), new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8834) });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "FCMToken");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1377), new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1382) });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4095), new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4096) });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -377,6 +377,40 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
b.ToTable("Equipment", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.FCMToken", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Token")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("FCMToken", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -692,13 +726,13 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1377),
|
||||
CreatedAt = new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5079),
|
||||
CreatedBy = "System",
|
||||
Email = "admin@nuvolar.hu",
|
||||
FirstName = "Administrator",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1382),
|
||||
LastModAt = new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5082),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
NFCActive = true,
|
||||
@@ -711,13 +745,13 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4095),
|
||||
CreatedAt = new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8830),
|
||||
CreatedBy = "System",
|
||||
Email = "user@nuvolar.hu",
|
||||
FirstName = "User",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4096),
|
||||
LastModAt = new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8834),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
NFCActive = true,
|
||||
|
||||
@@ -29,14 +29,14 @@ namespace WorkFlowCheck.MAUI
|
||||
_dbContext.Database.EnsureDeleted(); // Adatbázis törlése
|
||||
_dbContext.Database.EnsureCreated(); // Új adatbázis létrehozása
|
||||
|
||||
StartBackgroundTask();
|
||||
//StartBackgroundTask();
|
||||
MainPage = new AppShell();
|
||||
//MainPage = new NavigationPage(new MainPage(serviceProvider.GetRequiredService<IUserService>()));
|
||||
|
||||
}
|
||||
protected async override void OnResume()
|
||||
{
|
||||
StartBackgroundTask();
|
||||
//StartBackgroundTask();
|
||||
base.OnResume();
|
||||
var isLogged = await SecureStorage.Default.GetAsync("WFCUser");
|
||||
if (isLogged == null)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -9,6 +10,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckListHeader
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public virtual CheckListTemplateHeader? CheckListTemplateHeader { get; set; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckListRow
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int CheckListHeaderId { get; set; }
|
||||
public virtual CheckListHeader CheckListHeader { get; set; } = null!;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckListTemplateHeader
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Description { get; set; } = null!;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckListTemplateRow
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int RowIndex { get; set; }
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class CheckPoint
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class Equipment
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string EquipmentNumber { get; set; } = null!;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class Location
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string FullName { get; set; } = null!;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,6 +9,7 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public class MobileUser
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string? UserName { get; set; }
|
||||
|
||||
|
||||
@@ -19,10 +19,12 @@ namespace WorkFlowCheck.MAUI.Helper
|
||||
public static string DatabaseName = "";
|
||||
public static bool Syncronised = false;
|
||||
public static UserDTO SystemUserDTO;
|
||||
public static string ProgramVersion = "v1.1.020";
|
||||
public static string ProgramVersion = "v1.1.036";
|
||||
|
||||
#if DEBUG
|
||||
public static string ApiBaseUrl = $"https://dev.wfcapi.nuvolar.hu/";
|
||||
//public static string ApiBaseUrl = $"http://10.0.2.2:59027/";
|
||||
//public static string ApiBaseUrl = $"https://dev.wfcapi.nuvolar.hu/";
|
||||
public static string ApiBaseUrl = $"https://uat.wfcapi.nuvolar.hu/";
|
||||
public static string ApiKey = $"RUJeLSpSMzVASUdaRCEzUyYxRSE0VyFISFRSJC0zRzhLM1hCSDU=";
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace WorkFlowCheck.MAUI
|
||||
builder.Services.AddAutoMapper(typeof(MapperProfile));
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddDbContext<AppDbContext>();
|
||||
//builder.Services.AddSingleton<AppDbContext>();
|
||||
|
||||
|
||||
builder.Services.AddSingleton<IUserService, UserService>();
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="WorkFlowCheck.MAUI.Pages.CheckList.CheckListInfoPage"
|
||||
Title="CheckListInfoPage">
|
||||
<Shell.TitleView>
|
||||
<Grid Padding="2" VerticalOptions="Center">
|
||||
<Label x:Name="HeaderLabel" Text=""
|
||||
FontSize="22"
|
||||
FontAttributes="Bold"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Start" />
|
||||
<HorizontalStackLayout
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="End"
|
||||
Spacing="5">
|
||||
<Frame CornerRadius="1"
|
||||
Padding="5"
|
||||
HasShadow="True"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="End">
|
||||
<Label x:Name="DeviceId"
|
||||
FontSize="10"
|
||||
TextColor="Black"/>
|
||||
</Frame>
|
||||
<Frame CornerRadius="1"
|
||||
Padding="5"
|
||||
HasShadow="True"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="End">
|
||||
<Label x:Name="UserInfo"
|
||||
FontSize="10"
|
||||
FontAttributes="Bold"
|
||||
TextColor="Black"/>
|
||||
</Frame>
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
</Shell.TitleView>
|
||||
<Grid RowDefinitions="*" Padding="30,30">
|
||||
<Frame Grid.Row="0"
|
||||
BorderColor="Gray"
|
||||
Padding="5"
|
||||
Margin="1"
|
||||
CornerRadius="10"
|
||||
HasShadow="True">
|
||||
<StackLayout Grid.Column="1" Spacing="2">
|
||||
<Label x:Name="row1" FontSize="20" FontAttributes="Bold" />
|
||||
<Label x:Name="row2" Text="B" FontSize="20" />
|
||||
<Label x:Name="row3" Text="C" FontSize="20" />
|
||||
<Label x:Name="row4" Text="D" FontSize="20" />
|
||||
<Label x:Name="row5" Text="D" FontSize="25" FontAttributes="Bold"/>
|
||||
</StackLayout>
|
||||
</Frame>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,71 @@
|
||||
using Android.DeviceLock;
|
||||
using Firebase.Auth;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.MAUI.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Pages.CheckList;
|
||||
|
||||
public partial class CheckListInfoPage : ContentPage
|
||||
{
|
||||
private readonly ICheckListService _checkListService;
|
||||
private readonly IUserService _userService;
|
||||
private UserDTO _currentUser;
|
||||
private CheckListHeaderDTO _checkListHeaderDTO;
|
||||
private CheckListHeaderInfoDTO _checkListHeaderInfoDTO;
|
||||
public CheckListInfoPage(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
InitializeComponent();
|
||||
_userService = MauiProgram.ServiceProvider.GetRequiredService<IUserService>();
|
||||
_checkListService = MauiProgram.ServiceProvider.GetRequiredService<ICheckListService>();
|
||||
_checkListHeaderDTO = checkListHeaderDTO;
|
||||
}
|
||||
private async Task SetInfo()
|
||||
{
|
||||
_currentUser = _userService.GetCurrentUser();
|
||||
DeviceId.Text = _userService.DeviceId;
|
||||
UserInfo.Text = $"{_currentUser?.LastName} {_currentUser?.FirstName}";
|
||||
HeaderLabel.Text = _checkListHeaderDTO.DocumentNumber;
|
||||
}
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
BindingContext = this;
|
||||
await SetInfo();
|
||||
BuildCheckListHeaderInfo();
|
||||
}
|
||||
private async Task BuildCheckListHeaderInfo()
|
||||
{
|
||||
_checkListHeaderInfoDTO = new CheckListHeaderInfoDTO();
|
||||
|
||||
var result = _checkListHeaderDTO.CheckListRowDTO
|
||||
.GroupBy(r => 1)
|
||||
.Select(g => new
|
||||
{
|
||||
TotalRowCount = g.Count(),
|
||||
EmptyAnswerCount = g.Count(r => string.IsNullOrEmpty(r.Answer)),
|
||||
CheckPointCount = g.Select(r => r.CheckListTemplateRowDTO.CheckPointId).Distinct().Count()
|
||||
})
|
||||
.FirstOrDefault();
|
||||
if (result != null)
|
||||
{
|
||||
_checkListHeaderInfoDTO.TotalRowCount = result.TotalRowCount;
|
||||
_checkListHeaderInfoDTO.CheckPointCount = result.CheckPointCount;
|
||||
_checkListHeaderInfoDTO.EmptyAnswerCount = result.EmptyAnswerCount;
|
||||
if (_checkListHeaderInfoDTO.TotalRowCount > 0)
|
||||
{
|
||||
_checkListHeaderInfoDTO.ReadyPercent = ((double)(_checkListHeaderInfoDTO.TotalRowCount - _checkListHeaderInfoDTO.EmptyAnswerCount) / _checkListHeaderInfoDTO.TotalRowCount * 100)
|
||||
.ToString("0.00", new CultureInfo("hu-HU")) + " %";
|
||||
}
|
||||
}
|
||||
|
||||
var checkPointDTO = await _checkListService.GetNextCheckpointNotSend(_checkListHeaderDTO);
|
||||
|
||||
row1.Text = $"Összes ellenõrizendõ lépés: {_checkListHeaderInfoDTO.TotalRowCount} db";
|
||||
row2.Text = $"Összes még nem ellenõrzött lépés: {_checkListHeaderInfoDTO.EmptyAnswerCount} db";
|
||||
row3.Text = $"Ellenõrzési pontok száma: {_checkListHeaderInfoDTO.CheckPointCount} db";
|
||||
row4.Text = $"Készültség: {_checkListHeaderInfoDTO.ReadyPercent}";
|
||||
row5.Text = $"Következõ ellenõrzési pont : {checkPointDTO.ShortName}";
|
||||
}
|
||||
}
|
||||
@@ -82,16 +82,53 @@
|
||||
<DataTemplate>
|
||||
<Frame BorderColor="Gray" Padding="15" Margin="5" HasShadow="True" BackgroundColor="WhiteSmoke">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<!-- Bal oldali oszlop: Két Label egymás alatt -->
|
||||
<StackLayout Grid.Column="0" Spacing="2">
|
||||
<Grid ColumnSpacing="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Bal oldali gomb -->
|
||||
<Button Grid.Column="0"
|
||||
VerticalOptions="Center"
|
||||
Text="i"
|
||||
FontSize="17"
|
||||
FontAttributes="Bold"
|
||||
BackgroundColor="Purple"
|
||||
HeightRequest="40"
|
||||
WidthRequest="40"
|
||||
CornerRadius="20"
|
||||
BorderColor="Gray"
|
||||
BorderWidth="1"
|
||||
Command="{Binding BindingContext.InfoCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
|
||||
<!-- Jobb oldali szövegek -->
|
||||
<StackLayout Grid.Column="1" Spacing="2">
|
||||
<Label Text="{Binding DocumentNumber}" FontSize="14" FontAttributes="Bold" />
|
||||
<Label Text="{Binding DateExecution}" FontSize="12" />
|
||||
<Label Text="{Binding CheckListTemplateHeaderDTO.ShortName}" FontSize="10" />
|
||||
<Label Text="{Binding StatusName}" FontSize="10" />
|
||||
</StackLayout>
|
||||
</Grid>
|
||||
|
||||
<!-- Jobb oldali oszlop: Két gomb egymás mellett -->
|
||||
<HorizontalStackLayout Grid.Column="1" HorizontalOptions="End" Spacing="3">
|
||||
<Button Text="L"
|
||||
Margin="0,0,0,0"
|
||||
BackgroundColor="DarkOrange"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="50"
|
||||
MaximumWidthRequest="50"
|
||||
CornerRadius="25"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource CloseConverter}}"
|
||||
Command="{Binding BindingContext.CloseCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
<Button Text=""
|
||||
Margin="0,0,0,0"
|
||||
ImageSource="arrow_down.svg"
|
||||
@@ -161,6 +198,9 @@
|
||||
Margin="1"
|
||||
CornerRadius="10"
|
||||
HasShadow="True">
|
||||
<RefreshView x:Name="CheckListTemplateRefreshView"
|
||||
IsRefreshing="{Binding IsRefreshingT}"
|
||||
Command="{Binding RefreshCommandT}">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Új ellenőrzés" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
|
||||
@@ -191,6 +231,7 @@
|
||||
</CollectionView>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</RefreshView>
|
||||
</Frame>
|
||||
<Grid BackgroundColor="#80000000"
|
||||
IsVisible="{Binding IsLoading}"
|
||||
@@ -213,6 +254,7 @@
|
||||
<local:UnBlockedConverter x:Key="UnBlockedConverter" />
|
||||
<local:ContinueConverter x:Key="ContinueConverter" />
|
||||
<local:AcceptConverter x:Key="AcceptConverter" />
|
||||
<local:CloseConverter x:Key="CloseConverter" />
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
</ContentPage>
|
||||
@@ -9,6 +9,7 @@ using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.MAUI.Helper;
|
||||
using WorkFlowCheck.MAUI.Pages.NFC;
|
||||
using WorkFlowCheck.MAUI.Pages.System;
|
||||
using WorkFlowCheck.MAUI.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Pages.CheckList;
|
||||
@@ -27,7 +28,10 @@ public partial class CheckListPage : ContentPage
|
||||
public ICommand UnblockCommand { get; set; }
|
||||
public ICommand BlockCommand { get; set; }
|
||||
public ICommand AcceptCommand { get; set; }
|
||||
public ICommand InfoCommand { get; set; }
|
||||
public ICommand CloseCommand { get; set; }
|
||||
public ICommand RefreshCommand { get; }
|
||||
public ICommand RefreshCommandT { get; }
|
||||
|
||||
public bool IsLoading
|
||||
{
|
||||
@@ -49,6 +53,7 @@ public partial class CheckListPage : ContentPage
|
||||
}
|
||||
|
||||
private bool _isRefreshing;
|
||||
private bool _isRefreshingT;
|
||||
public bool IsRefreshing
|
||||
{
|
||||
get => _isRefreshing;
|
||||
@@ -61,6 +66,18 @@ public partial class CheckListPage : ContentPage
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool IsRefreshingT
|
||||
{
|
||||
get => _isRefreshingT;
|
||||
set
|
||||
{
|
||||
if (_isRefreshingT != value)
|
||||
{
|
||||
_isRefreshingT = value;
|
||||
OnPropertyChanged(nameof(IsRefreshingT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CheckListPage()
|
||||
{
|
||||
@@ -73,7 +90,10 @@ public partial class CheckListPage : ContentPage
|
||||
UnblockCommand = new Command<CheckListHeaderDTO>(OnUnblockItem);
|
||||
BlockCommand = new Command<CheckListHeaderDTO>(OnBlockItem);
|
||||
AcceptCommand = new Command<CheckListHeaderDTO>(OnAcceptItem);
|
||||
InfoCommand = new Command<CheckListHeaderDTO>(OnInfoItem);
|
||||
CloseCommand = new Command<CheckListHeaderDTO>(OnCloseItem);
|
||||
RefreshCommand = new Command(async () => await OnRefresh());
|
||||
RefreshCommandT = new Command(async () => await OnRefreshT());
|
||||
|
||||
}
|
||||
private async void OnSyncClicked(object sender, EventArgs e)
|
||||
@@ -123,6 +143,16 @@ public partial class CheckListPage : ContentPage
|
||||
|
||||
IsRefreshing = false;
|
||||
}
|
||||
private async Task OnRefreshT()
|
||||
{
|
||||
IsRefreshingT = true;
|
||||
|
||||
//await _syncService.SyncCheckListHeader_Down((d, s) => { });
|
||||
|
||||
await LoadCheckListTemplate();
|
||||
|
||||
IsRefreshingT = false;
|
||||
}
|
||||
private void SetInfo()
|
||||
{
|
||||
_currentUser = _userService.GetCurrentUser();
|
||||
@@ -283,6 +313,43 @@ public partial class CheckListPage : ContentPage
|
||||
}
|
||||
}
|
||||
}
|
||||
private async void OnCloseItem(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
var popup = new InputPopup("Kérem adja meg a lezárás okát!");
|
||||
var (isConfirmed, userInput) = await popup.ShowAsync();
|
||||
|
||||
|
||||
if (isConfirmed && !string.IsNullOrEmpty(userInput))
|
||||
{
|
||||
var checkListHeaderCloseDTO = new CheckListHeaderCloseDTO()
|
||||
{
|
||||
Id = checkListHeaderDTO.Id,
|
||||
CloseReason = userInput,
|
||||
UserId = _userService.GetCurrentUser().Id
|
||||
};
|
||||
var success = await _checkListService.CloseCheckListHeader(checkListHeaderCloseDTO);
|
||||
if (success)
|
||||
{
|
||||
IsRefreshing = true;
|
||||
await LoadCheckList();
|
||||
IsRefreshing = false;
|
||||
await SystemHelper.ShowSnackBar("Lezárás sikeres!",
|
||||
SystemHelper.ColorToHex(Colors.Green),
|
||||
SystemHelper.ColorToHex(Colors.Green),
|
||||
SystemHelper.ColorToHex(Colors.White),
|
||||
5);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
await SystemHelper.ShowSnackBar("Lezárás SIKERTELEN!",
|
||||
SystemHelper.ColorToHex(Colors.Red),
|
||||
SystemHelper.ColorToHex(Colors.Red),
|
||||
SystemHelper.ColorToHex(Colors.Yellow),
|
||||
15);
|
||||
}
|
||||
}
|
||||
}
|
||||
private async void OnAcceptItem(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
bool answer = await DisplayAlert("Megerõsítés", "Biztosan jóváhagyod a folyamatot?", "Igen", "Mégsem");
|
||||
@@ -311,6 +378,10 @@ public partial class CheckListPage : ContentPage
|
||||
}
|
||||
}
|
||||
}
|
||||
private async void OnInfoItem(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
await Navigation.PushAsync(new CheckListInfoPage(checkListHeaderDTO));
|
||||
}
|
||||
private async Task LoadCheckListTemplate()
|
||||
{
|
||||
IsLoading = true;
|
||||
@@ -338,7 +409,11 @@ public partial class CheckListPage : ContentPage
|
||||
if (!isAdmin)
|
||||
{
|
||||
var result = checkListHeaderDTOs
|
||||
.Where(w => w.UserId == userDTO.Id && w.CheckStatus != CheckStatus.Blocked).ToList();
|
||||
.Where(w => w.UserId == userDTO.Id &&
|
||||
//w.CheckStatus != CheckStatus.Blocked &&
|
||||
w.CheckStatus != CheckStatus.Sent &&
|
||||
w.CheckStatus != CheckStatus.Closed
|
||||
).ToList();
|
||||
CheckList.ItemsSource = result;
|
||||
}
|
||||
|
||||
@@ -372,6 +447,31 @@ public class BlockedConverter : IValueConverter
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public class CloseConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var canEnableBlocked = false;
|
||||
foreach (var roleDTO in SystemHelper.SystemUserDTO.RoleDTO)
|
||||
{
|
||||
if (roleDTO.CanEnableBlocked)
|
||||
{
|
||||
canEnableBlocked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (value is CheckStatus status && canEnableBlocked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public class UnBlockedConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.ComponentModel;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Pages.CheckList
|
||||
{
|
||||
public class CheckListRowCS : INotifyPropertyChanged
|
||||
{
|
||||
private byte[] _photoBytes;
|
||||
private ImageSource? _photo;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public int Id { get; set; }
|
||||
public string AnswerType { get; set; } = null!;
|
||||
public int RowIndex { get; set; }
|
||||
public string OperationDescription { get; set; } = null!;
|
||||
public string GroupName { get; set; } = null!;
|
||||
public string Answer { get; set; } = null!;
|
||||
public bool? AnswerYes { get; set; } = null!;
|
||||
public bool? AnswerNo { get; set; } = null!;
|
||||
public byte[] PhotoBytes
|
||||
{
|
||||
get => _photoBytes;
|
||||
set
|
||||
{
|
||||
if (_photoBytes != value)
|
||||
{
|
||||
_photoBytes = value;
|
||||
_photo = null;
|
||||
OnPropertyChanged(nameof(PhotoBytes));
|
||||
OnPropertyChanged(nameof(Photo));
|
||||
}
|
||||
}
|
||||
}
|
||||
public ImageSource Photo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_photo == null)
|
||||
{
|
||||
if (PhotoBytes != null && PhotoBytes.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bytesCopy = PhotoBytes.ToArray();
|
||||
_photo = ImageSource.FromStream(() => new MemoryStream(bytesCopy));
|
||||
}
|
||||
catch
|
||||
{
|
||||
_photo = ImageSource.FromFile("noimage.png");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_photo = ImageSource.FromFile("noimage.png");
|
||||
}
|
||||
}
|
||||
|
||||
return _photo;
|
||||
}
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string name) =>
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="WorkFlowCheck.MAUI.Pages.CheckList.CheckListWorkPage"
|
||||
xmlns:templateselectors="clr-namespace:WorkFlowCheck.MAUI.TemplateSelectors"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:local="clr-namespace:WorkFlowCheck.MAUI.Pages.CheckList"
|
||||
BackgroundColor="#f0f0f0"
|
||||
Title="">
|
||||
@@ -47,7 +48,7 @@
|
||||
<Frame BorderColor="Gray" Padding="1" Margin="2" HasShadow="True" CornerRadius="2">
|
||||
<CollectionView x:Name="CheckPointCheckListRows"
|
||||
HeightRequest="555"
|
||||
ItemsSource="{Binding CheckListRows}"
|
||||
ItemsSource="{Binding CheckListRowCSs}"
|
||||
ItemTemplate="{StaticResource AnswerTemplateSelector}">
|
||||
<CollectionView.EmptyView>
|
||||
<Label Text="Nincsenek feladatok." HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
@@ -92,8 +93,8 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex,StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" />
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex,StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" />
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*,*">
|
||||
<Label Text="I" Grid.Column="0" HorizontalTextAlignment="Center"/>
|
||||
<Label Text="N" Grid.Column="1" HorizontalTextAlignment="Center"/>
|
||||
@@ -104,14 +105,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerYes}"
|
||||
IsChecked="{Binding AnswerYes, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerNo}"
|
||||
IsChecked="{Binding AnswerNo, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -125,8 +126,8 @@
|
||||
<ColumnDefinition Width="3*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex,StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex,StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="Auto,Auto" VerticalOptions="Center">
|
||||
<Image Grid.Column="0"
|
||||
WidthRequest="95"
|
||||
@@ -134,10 +135,11 @@
|
||||
Aspect="AspectFill"
|
||||
Margin="0,0,10,0"
|
||||
VerticalOptions="Center"
|
||||
Source="{Binding Photo, Converter={StaticResource ByteArrayToImageSourceConverter}}" />
|
||||
Source="{Binding Photo}" >
|
||||
</Image>
|
||||
<Button Text="📷" Grid.Column="1"
|
||||
VerticalOptions="Center"
|
||||
Command="{Binding BindingContext.CreatePhoto, Source={x:Reference CheckPointCheckListRows}}"
|
||||
Command="{Binding BindingContext.TakePhoto, Source={x:Reference CheckPointCheckListRows}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -152,8 +154,8 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex,StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex,StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*">
|
||||
<Label Text="Érték megadása szükséges" Grid.Column="0" HorizontalTextAlignment="Center"/>
|
||||
</Grid>
|
||||
@@ -173,8 +175,8 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*,*">
|
||||
<Label Text="I" Grid.Column="0" BackgroundColor="Yellow" TextColor="Black" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="N" Grid.Column="1" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
@@ -185,14 +187,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerYes}"
|
||||
IsChecked="{Binding AnswerYes, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerNo}"
|
||||
IsChecked="{Binding AnswerNo, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -207,8 +209,8 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*,*">
|
||||
<Label Text="I" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="N" Grid.Column="1" BackgroundColor="Yellow" TextColor="Black" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
@@ -219,14 +221,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerYes}"
|
||||
IsChecked="{Binding AnswerYes, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerNo}"
|
||||
IsChecked="{Binding AnswerNo, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -241,8 +243,8 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*,*">
|
||||
<Label Text="I" Grid.Column="0" BackgroundColor="Red" TextColor="Black" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="N" Grid.Column="1" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
@@ -253,14 +255,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerYes}"
|
||||
IsChecked="{Binding AnswerYes, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerNo}"
|
||||
IsChecked="{Binding AnswerNo, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -275,8 +277,8 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding CheckListTemplateRowDTO.OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Label Text="{Binding RowIndex, StringFormat='{}{0:D1}.'}" BackgroundColor="WhiteSmoke" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="{Binding OperationDescription}" BackgroundColor="WhiteSmoke" Grid.Column="1" />
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*,*">
|
||||
<Label Text="I" Grid.Column="0" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
<Label Text="N" Grid.Column="1" BackgroundColor="Red" TextColor="Black" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
|
||||
@@ -287,14 +289,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerYes}"
|
||||
IsChecked="{Binding AnswerYes, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding AnswerNo}"
|
||||
IsChecked="{Binding AnswerNo, Mode=TwoWay}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -308,6 +310,5 @@
|
||||
PI_N_Template="{StaticResource PI_N_Template}"
|
||||
I_PN_Template="{StaticResource I_PN_Template}"
|
||||
V_Template="{StaticResource V_Template}"/>
|
||||
<local:ByteArrayToImageSourceConverter x:Key="ByteArrayToImageSourceConverter"/>
|
||||
</ContentPage.Resources>
|
||||
</ContentPage>
|
||||
@@ -29,8 +29,10 @@ public partial class CheckListWorkPage : ContentPage
|
||||
OnPropertyChanged(nameof(IsLoading));
|
||||
}
|
||||
}
|
||||
public ObservableCollection<CheckListRowDTO> CheckListRows { get; set; } = new ObservableCollection<CheckListRowDTO>();
|
||||
public ICommand CreatePhoto { get; set; }
|
||||
public ObservableCollection<CheckListRowCS> CheckListRowCSs { get; set; } = new ObservableCollection<CheckListRowCS>();
|
||||
public List<CheckListRowDTO> CheckListRowDTOs { get; set; }
|
||||
|
||||
public ICommand TakePhoto { get; set; }
|
||||
public ICommand SendCommand { get; set; }
|
||||
public ICommand SaveCommand { get; set; }
|
||||
|
||||
@@ -109,26 +111,31 @@ public partial class CheckListWorkPage : ContentPage
|
||||
}
|
||||
|
||||
}
|
||||
private async Task OnSave()
|
||||
private async Task OnSave(bool withReload = true)
|
||||
{
|
||||
IsLoading = true;
|
||||
try
|
||||
{
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
foreach (var checkListRow in CheckListRows)
|
||||
foreach (var checkListRowCS in CheckListRowCSs)
|
||||
{
|
||||
if (checkListRow.AnswerYes == true)
|
||||
var checkListRowDTO = CheckListRowDTOs.Where(w => w.Id == checkListRowCS.Id).FirstOrDefault();
|
||||
|
||||
if (checkListRowDTO != null)
|
||||
{
|
||||
checkListRow.Answer = "Igen";
|
||||
}
|
||||
if (checkListRow.AnswerNo == true)
|
||||
if (checkListRowDTO.AnswerYes == true)
|
||||
{
|
||||
checkListRow.Answer = "Nem";
|
||||
checkListRowDTO.Answer = "Igen";
|
||||
}
|
||||
await _checkListService.UpdateCheckListRow(checkListRow);
|
||||
if (checkListRowDTO.AnswerNo == true)
|
||||
{
|
||||
checkListRowDTO.Answer = "Nem";
|
||||
}
|
||||
await LoadCheckPointCheckListRows();
|
||||
await _checkListService.UpdateCheckListRow(checkListRowDTO, withReload);
|
||||
}
|
||||
}
|
||||
if (withReload) await LoadCheckPointCheckListRows();
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -146,29 +153,15 @@ public partial class CheckListWorkPage : ContentPage
|
||||
base.OnAppearing();
|
||||
BindingContext = this;
|
||||
await SetInfo();
|
||||
CreatePhoto = new Command<CheckListRowDTO>(OnTakePhoto);
|
||||
TakePhoto = new Command<CheckListRowCS>(OnTakePhoto);
|
||||
await LoadCheckPointCheckListRows();
|
||||
|
||||
}
|
||||
private async void OnTakePhoto(CheckListRowDTO checkListRowDTO)
|
||||
private async Task<byte[]> ResizePicture(FileResult? photo, int newWidth)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MediaPicker.IsCaptureSupported)
|
||||
{
|
||||
await OnSave();
|
||||
var photo = await MediaPicker.CapturePhotoAsync();
|
||||
if (photo != null)
|
||||
{
|
||||
//using var stream = await photo.OpenReadAsync();
|
||||
//using var ms = new MemoryStream();
|
||||
//await stream.CopyToAsync(ms);
|
||||
//byte[] photoBytes = ms.ToArray();
|
||||
|
||||
using var stream = await photo.OpenReadAsync();
|
||||
using var originalBitmap = SKBitmap.Decode(stream);
|
||||
|
||||
int newWidth = 500;
|
||||
int newHeight = (int)(originalBitmap.Height * ((double)newWidth / originalBitmap.Width));
|
||||
|
||||
using var surface = SKSurface.Create(new SKImageInfo(newWidth, newHeight));
|
||||
@@ -181,13 +174,32 @@ public partial class CheckListWorkPage : ContentPage
|
||||
using var resizedImage = surface.Snapshot();
|
||||
using var data = resizedImage.Encode(SKEncodedImageFormat.Jpeg, 100);
|
||||
|
||||
checkListRowDTO.Photo = data.ToArray();
|
||||
return data.ToArray();
|
||||
}
|
||||
private async void OnTakePhoto(CheckListRowCS checkListRowCS)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MediaPicker.IsCaptureSupported)
|
||||
{
|
||||
await OnSave(false);
|
||||
var photo = await MediaPicker.CapturePhotoAsync();
|
||||
if (photo != null)
|
||||
{
|
||||
checkListRowCS.PhotoBytes = await ResizePicture(photo, 500);
|
||||
checkListRowCS.Answer = "Igen";
|
||||
|
||||
var checkListRowDTO = CheckListRowDTOs.FirstOrDefault(w => w.Id == checkListRowCS.Id);
|
||||
if (checkListRowDTO != null)
|
||||
{
|
||||
checkListRowDTO.Photo = checkListRowCS.PhotoBytes;
|
||||
checkListRowDTO.Answer = "Igen";
|
||||
|
||||
await _checkListService.UpdateCheckListRow(checkListRowDTO);
|
||||
await _checkListService.UpdateCheckListRow(checkListRowDTO, true);
|
||||
await LoadCheckPointCheckListRows();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("A fényképezés nem támogatott ezen az eszközön.");
|
||||
@@ -202,9 +214,11 @@ public partial class CheckListWorkPage : ContentPage
|
||||
{
|
||||
IsLoading = true;
|
||||
|
||||
CheckListRows.Clear();
|
||||
var checkListRowDTOs = await _checkListService.GetCheckListRowsByCheckPointCode(_currentUser.Id, _checkListHeaderId, _checkPointCode);
|
||||
foreach (var item in checkListRowDTOs)
|
||||
CheckListRowCSs.Clear();
|
||||
|
||||
CheckListRowDTOs = await _checkListService.GetCheckListRowsByCheckPointCode(_currentUser.Id, _checkListHeaderId, _checkPointCode);
|
||||
|
||||
foreach (var item in CheckListRowDTOs)
|
||||
{
|
||||
if (item.Answer == "Igen")
|
||||
{
|
||||
@@ -216,7 +230,20 @@ public partial class CheckListWorkPage : ContentPage
|
||||
item.AnswerYes = false;
|
||||
item.AnswerNo = true;
|
||||
}
|
||||
CheckListRows.Add(item);
|
||||
var checkListRowCS = new CheckListRowCS()
|
||||
{
|
||||
Answer = item.Answer,
|
||||
AnswerNo = item.AnswerNo,
|
||||
AnswerYes = item.AnswerYes,
|
||||
GroupName = $"AnswerGroup_{item.CheckListTemplateRowDTO?.Id ?? 0}",
|
||||
Id = item.Id,
|
||||
RowIndex = item.CheckListTemplateRowDTO?.RowIndex ?? 0,
|
||||
OperationDescription = item.CheckListTemplateRowDTO?.OperationDescription ?? "N/A",
|
||||
AnswerType = item.CheckListTemplateRowDTO?.AnswerType ?? "I-N",
|
||||
PhotoBytes = item.Photo ?? Array.Empty<byte>(),
|
||||
};
|
||||
|
||||
CheckListRowCSs.Add(checkListRowCS);
|
||||
}
|
||||
|
||||
IsLoading = false;
|
||||
@@ -241,20 +268,32 @@ public class BindableRadioButton : RadioButton
|
||||
radioButton.GroupName = newGroupName;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class ByteArrayToImageSourceConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
public BindableRadioButton()
|
||||
{
|
||||
if (value is byte[] bytes && bytes.Length > 0)
|
||||
{
|
||||
return ImageSource.FromStream(() => new MemoryStream(bytes));
|
||||
CheckedChanged += OnCheckedChangedInternal;
|
||||
}
|
||||
private void OnCheckedChangedInternal(object sender, CheckedChangedEventArgs e)
|
||||
{
|
||||
if (e.Value && BindingContext is CheckListRowDTO dto)
|
||||
{
|
||||
if (Value?.ToString() == "Igen")
|
||||
dto.Answer = "Igen";
|
||||
else if (Value?.ToString() == "Nem")
|
||||
dto.Answer = "Nem";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
protected override void OnBindingContextChanged()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
base.OnBindingContextChanged();
|
||||
|
||||
if (BindingContext is CheckListRowDTO dto)
|
||||
{
|
||||
if (Value?.ToString() == "Igen")
|
||||
IsChecked = dto.Answer == "Igen";
|
||||
else if (Value?.ToString() == "Nem")
|
||||
IsChecked = dto.Answer == "Nem";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public partial class LoginPage : BasePage
|
||||
public LoginPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitFirebase();
|
||||
|
||||
SetContent(LoginContent);
|
||||
_userService = MauiProgram.ServiceProvider.GetRequiredService<IUserService>();
|
||||
_syncService = MauiProgram.ServiceProvider.GetRequiredService<ISyncService>();
|
||||
@@ -37,7 +37,19 @@ public partial class LoginPage : BasePage
|
||||
_userService.SetCurrentUser(response.Data);
|
||||
SystemHelper.SystemUserDTO = response.Data;
|
||||
|
||||
|
||||
var needFCM = false;
|
||||
foreach (var role in response.Data.RoleDTO)
|
||||
{
|
||||
if (role.CanEnableBlocked)
|
||||
{
|
||||
needFCM = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (needFCM)
|
||||
{
|
||||
await InitFirebase();
|
||||
}
|
||||
|
||||
var wFCUser = Newtonsoft.Json.JsonConvert.SerializeObject(response.Data);
|
||||
await SecureStorage.Default.SetAsync("WFCUser", "wFCUser");
|
||||
@@ -169,7 +181,7 @@ public partial class LoginPage : BasePage
|
||||
|
||||
}
|
||||
|
||||
private async void InitFirebase()
|
||||
private async Task InitFirebase()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:popups="clr-namespace:WorkFlowCheck.MAUI.Pages.System"
|
||||
x:Class="WorkFlowCheck.MAUI.Pages.System.InputPopup">
|
||||
|
||||
<toolkit:Popup.Resources>
|
||||
<Style TargetType="{x:Type popups:InputPopup}">
|
||||
<Setter Property="Size" Value="400,150" />
|
||||
<Setter Property="HorizontalOptions" Value="Center" />
|
||||
<Setter Property="VerticalOptions" Value="Start" />
|
||||
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
|
||||
</Style>
|
||||
</toolkit:Popup.Resources>
|
||||
<VerticalStackLayout Padding="20" Spacing="10">
|
||||
<Label x:Name="UserConfirmationLabel" />
|
||||
<Entry x:Name="UserInputEntry" />
|
||||
<HorizontalStackLayout HorizontalOptions="End" Spacing="10">
|
||||
<Button Text="Mégsem" Clicked="OnCancelClicked" />
|
||||
<Button Text="Megerősít" Clicked="OnOkClicked" />
|
||||
</HorizontalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
|
||||
</toolkit:Popup>
|
||||
@@ -0,0 +1,42 @@
|
||||
using CommunityToolkit.Maui.Core;
|
||||
using CommunityToolkit.Maui.Views;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Pages.System;
|
||||
|
||||
public partial class InputPopup : Popup
|
||||
{
|
||||
private TaskCompletionSource<(bool IsConfirmed, string Result)> _taskCompletionSource;
|
||||
public InputPopup(string userConfirmationLabel)
|
||||
{
|
||||
InitializeComponent();
|
||||
_taskCompletionSource = new();
|
||||
UserConfirmationLabel.Text = userConfirmationLabel;
|
||||
this.Closed += OnPopupClosed;
|
||||
}
|
||||
public Task<(bool IsConfirmed, string Result)> ShowAsync()
|
||||
{
|
||||
Application.Current.MainPage.ShowPopup(this);
|
||||
return _taskCompletionSource.Task;
|
||||
}
|
||||
private void OnOkClicked(object sender, EventArgs e)
|
||||
{
|
||||
Close((true, UserInputEntry.Text));
|
||||
}
|
||||
|
||||
private void OnCancelClicked(object sender, EventArgs e)
|
||||
{
|
||||
Close((false, ""));
|
||||
}
|
||||
private void OnPopupClosed(object sender, PopupClosedEventArgs e)
|
||||
{
|
||||
if (e?.Result is ValueTuple<bool, string> value)
|
||||
{
|
||||
_taskCompletionSource.TrySetResult(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
_taskCompletionSource.TrySetResult((false, null));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
android:icon="@mipmap/appicon"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:label="Workflow Check App">
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.Media;
|
||||
using Android.Nfc;
|
||||
using Android.OS;
|
||||
using Firebase;
|
||||
@@ -103,11 +104,24 @@ namespace WorkFlowCheck.MAUI
|
||||
}
|
||||
private void CreateNotificationChannel()
|
||||
{
|
||||
var soundUri = Android.Net.Uri.Parse($"android.resource://{Android.App.Application.Context.PackageName}/raw/siren_alert");
|
||||
|
||||
|
||||
var audioAttributes = new AudioAttributes.Builder()
|
||||
.SetUsage(AudioUsageKind.Notification)
|
||||
.SetContentType(AudioContentType.Sonification)
|
||||
.Build();
|
||||
|
||||
var channelId = $"{PackageName}.general";
|
||||
var channel = new NotificationChannel(channelId, "General", NotificationImportance.High);
|
||||
|
||||
channel.SetSound(soundUri, audioAttributes);
|
||||
|
||||
var notificationManager = (NotificationManager)GetSystemService(NotificationService);
|
||||
var channel = new NotificationChannel(channelId, "General", NotificationImportance.Default);
|
||||
notificationManager.CreateNotificationChannel(channel);
|
||||
FirebaseCloudMessagingImplementation.ChannelId = channelId;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<!--Set application-wide security config using base-config tag.-->
|
||||
<base-config cleartextTrafficPermitted="true"/>
|
||||
</network-security-config>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
@@ -2,6 +2,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http.Json;
|
||||
using System.Runtime.CompilerServices;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
@@ -99,7 +100,8 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
.Include(i => i.CheckListTemplateHeader)
|
||||
.Where(w => w.CheckStatus == CheckStatus.Open ||
|
||||
w.CheckStatus == CheckStatus.InProgress ||
|
||||
w.CheckStatus == CheckStatus.Blocked)
|
||||
w.CheckStatus == CheckStatus.Blocked ||
|
||||
w.CheckStatus == CheckStatus.Sent)
|
||||
.ToListAsync();
|
||||
retVal = _mapper.Map<List<CheckListHeaderDTO>>(res);
|
||||
}
|
||||
@@ -155,24 +157,27 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<CheckListRowDTO> UpdateCheckListRow(CheckListRowDTO checkListRowDTO)
|
||||
public async Task<CheckListRowDTO> UpdateCheckListRow(CheckListRowDTO checkListRowDTO, bool withPhoto = true)
|
||||
{
|
||||
var retVal = checkListRowDTO;
|
||||
try
|
||||
{
|
||||
var checkListRow = await _dbContext.CheckListRows.Where(w => w.Id == checkListRowDTO.Id).FirstOrDefaultAsync();
|
||||
var checkListRow = await _dbContext.CheckListRows
|
||||
//.AsNoTracking()
|
||||
.Where(w => w.Id == checkListRowDTO.Id).FirstOrDefaultAsync();
|
||||
if (checkListRow != null)
|
||||
{
|
||||
checkListRow.Answer = checkListRowDTO.Answer;
|
||||
if (checkListRowDTO.Photo != null && checkListRowDTO.Photo.Length > 0)
|
||||
if (checkListRowDTO.Photo != null && checkListRowDTO.Photo.Length > 0 && withPhoto)
|
||||
{
|
||||
checkListRow.Photo = checkListRowDTO.Photo;
|
||||
}
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
@@ -239,6 +244,42 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> CloseCheckListHeader(CheckListHeaderCloseDTO checkListHeaderCloseDTO)
|
||||
{
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var checkListHeader = await _dbContext.CheckListHeaders
|
||||
.Where(w => w.Id == checkListHeaderCloseDTO.Id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (checkListHeader != null)
|
||||
{
|
||||
var userDTO = _userService.GetCurrentUser();
|
||||
var endpoint = $"{_httpClient.BaseAddress}api/CheckList/CloseCheckListHeader";
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, checkListHeaderCloseDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
var jsonString = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var response = JsonConvert.DeserializeObject<ApiResponseDTO<bool>>(jsonString);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
checkListHeader.CheckStatus = CheckStatus.Closed;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal = false;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> AcceptCheckListHeader(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
var retVal = false;
|
||||
|
||||
@@ -17,10 +17,11 @@ namespace WorkFlowCheck.MAUI.Services.Interfaces
|
||||
Task<List<CheckListHeaderDTO>> GetCheckLists(int userId);
|
||||
Task<List<CheckListTemplateHeaderDTO>> GetCheckListTemplates(int userId);
|
||||
Task<List<CheckListRowDTO>> GetCheckListRowsByCheckPointCode(int userId, int checkListHeaderId, string checkPointCode);
|
||||
Task<CheckListRowDTO> UpdateCheckListRow(CheckListRowDTO checkListRowDTO);
|
||||
Task<CheckListRowDTO> UpdateCheckListRow(CheckListRowDTO checkListRowDTO, bool withPhoto = true);
|
||||
|
||||
Task<bool> UnBlockCheckListHeader(CheckListHeaderDTO checkListHeaderDTO);
|
||||
Task<bool> BlockCheckListHeader(CheckListHeaderDTO checkListHeaderDTO);
|
||||
Task<bool> CloseCheckListHeader(CheckListHeaderCloseDTO checkListHeaderCloseDTO);
|
||||
Task<bool> AcceptCheckListHeader(CheckListHeaderDTO checkListHeaderDTO);
|
||||
Task<CheckPointDTO> GetNextCheckpointNotSend(CheckListHeaderDTO checkListHeaderDTO);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ namespace WorkFlowCheck.MAUI.Services.Interfaces
|
||||
Task<ApiResponseDTO<string>> SyncUsers_Up(Action<double, string> reportProgress);
|
||||
Task SyncUsers_Down(Action<double, string> reportProgress);
|
||||
|
||||
Task<bool> UploadFCMToken(string token);
|
||||
Task<ApiResponseDTO<bool>> UploadFCMToken(string token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
{
|
||||
if (responseList.IsSuccess)
|
||||
{
|
||||
var entityList = await _dbContext.Locations.ToListAsync();
|
||||
var entityList = await _dbContext.Equipments.ToListAsync();
|
||||
var missingItems = responseList.Data.Where(f => !entityList.Any(s => s.Id == f.Id)).ToList();
|
||||
|
||||
var mappedMissingItems = _mapper.Map<List<Equipment>>(missingItems);
|
||||
|
||||
@@ -50,6 +50,21 @@ namespace WorkFlowCheck.MAUI.TemplateSelectors
|
||||
_ => I_N_Template
|
||||
};
|
||||
}
|
||||
if (item is CheckListRowCS model3)
|
||||
{
|
||||
return model3.AnswerType switch
|
||||
{
|
||||
"I-N" => I_N_Template,
|
||||
"P" => P_Template,
|
||||
"PN" => P_Template,
|
||||
"V" => V_Template,
|
||||
"SI-N" => SI_N_Template,
|
||||
"I-SN" => I_SN_Template,
|
||||
"PI-N" => PI_N_Template,
|
||||
"I-PN" => I_PN_Template,
|
||||
_ => I_N_Template
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Remove="Platforms\Android\Resources\values\strings.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Platforms\Android\Resources\xml\network_security_config.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Platforms\Android\Resources\xml\file_paths.xml" />
|
||||
@@ -130,6 +133,9 @@
|
||||
<MauiXaml Update="Pages\BaseStock\Locations\LocationsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
<MauiXaml Update="Pages\CheckList\CheckListInfoPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
<MauiXaml Update="Pages\CheckList\CheckListPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
@@ -154,6 +160,9 @@
|
||||
<MauiXaml Update="Pages\System\DownloadAPKPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
<MauiXaml Update="Pages\System\InputPopup.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
<MauiXaml Update="Pages\System\SyncPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
dotnet publish -f net8.0-android -c Release -p:AndroidPackageFormat=apk
|
||||
dotnet publish -f net8.0-android -c Release -p:AndroidPackageFormat=apk
|
||||
pause
|
||||
@@ -0,0 +1,44 @@
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||
|
||||
namespace WorkFlowCheck.Web.Helpers
|
||||
{
|
||||
[HtmlTargetElement("input", Attributes = "asp-for-datatype")]
|
||||
public class AspForDataTypeTagHelper : TagHelper
|
||||
{
|
||||
[HtmlAttributeName("asp-for-datatype")]
|
||||
public ModelExpression For { get; set; }
|
||||
|
||||
public override void Process(TagHelperContext context, TagHelperOutput output)
|
||||
{
|
||||
if (For == null) return;
|
||||
|
||||
var type = For.ModelExplorer.ModelType;
|
||||
|
||||
string dataType = GetDataTypeString(type);
|
||||
output.Attributes.SetAttribute("data-type", dataType);
|
||||
|
||||
// 🔥 EZ HIÁNYZIK → Rakd be!
|
||||
output.Attributes.RemoveAll("asp-for-datatype");
|
||||
}
|
||||
|
||||
|
||||
private string GetDataTypeString(Type type)
|
||||
{
|
||||
// Nullable<T> esetén nyerjük ki az alaptípust
|
||||
if (Nullable.GetUnderlyingType(type) is Type underlyingType)
|
||||
{
|
||||
type = underlyingType;
|
||||
}
|
||||
|
||||
if (type == typeof(string)) return "string";
|
||||
if (type == typeof(int) || type == typeof(long) || type == typeof(float) ||
|
||||
type == typeof(double) || type == typeof(decimal)) return "number";
|
||||
if (type == typeof(bool)) return "bool";
|
||||
if (type == typeof(DateTime)) return "date";
|
||||
|
||||
return "string"; // default fallback
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace WorkFlowCheck.Web.Helpers
|
||||
public static class SystemHelper
|
||||
{
|
||||
public static string DatabaseName = "";
|
||||
public static string ProgramVersion = "v1.1.019";
|
||||
public static string ProgramVersion = "v1.1.030";
|
||||
|
||||
public async static Task GetAPIInfoAsync(IConfiguration configuration)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
$('#tbEquipmentsPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
deleteEntity(table, '/BaseStock/Equipments/EquipmentPage?handler=DeleteEquipment', row.id);
|
||||
deleteEntity(table, '/BaseStock/Equipments/EquipmentsPage?handler=DeleteEquipment', row.id);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Full name</th>
|
||||
<th>@DisplayNameHelper.GetDisplayName(nameof(LocationDTO.FullName), typeof(LocationDTO))</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Full name</th>
|
||||
<th>@DisplayNameHelper.GetDisplayName(nameof(LocationDTO.FullName), typeof(LocationDTO))</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
+23
-5
@@ -33,16 +33,23 @@
|
||||
<div class="tab-pane fade show active" id="general" role="tabpanel">
|
||||
<form method="post" id="CheckListHeaderForm">
|
||||
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.Id" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.Id" data-type="int" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.IsEditable" data-type="bool" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.IsStorno" data-type="bool" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.GuidNumber" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.CheckListTemplateHeaderId" data-type="int" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.UserId" data-type="int" />
|
||||
<input type="hidden" name="CheckListHeaderDTO.DateExecution" value="@Model.CheckListHeaderDTO.DateExecution.ToString("yyyy-MM-dd")" />
|
||||
<input type="hidden" asp-for="CheckListHeaderDTO.AcceptUserId" data-type="int" />
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label asp-for="CheckListHeaderDTO.DocumentNumber"></label>
|
||||
<input asp-for="CheckListHeaderDTO.DocumentNumber" class="form-control" readonly/>
|
||||
<input asp-for="CheckListHeaderDTO.DocumentNumber" class="form-control" readonly />
|
||||
<span asp-validation-for="CheckListHeaderDTO.DocumentNumber" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="CheckListHeaderDTO.CheckStatus"></label>
|
||||
<select asp-for="CheckListHeaderDTO.CheckStatus" class="form-control" asp-items="Model.CheckStatus" readonly></select>
|
||||
<select asp-for="CheckListHeaderDTO.CheckStatus" class="form-control" asp-items="Model.CheckStatus" readonly data-type="int"></select>
|
||||
<span asp-validation-for="CheckListHeaderDTO.CheckStatus" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,7 +209,7 @@
|
||||
var formData = getFormAsNestedObject('#CheckListHeaderForm');
|
||||
const $form = $('#CheckListHeaderForm');
|
||||
|
||||
formData.CheckListHeader.RoleDTO=[];
|
||||
formData.CheckListHeaderDTO.CheckListRowDTO=[];
|
||||
|
||||
if ($form.valid())
|
||||
{
|
||||
@@ -213,13 +220,24 @@
|
||||
'X-CSRF-TOKEN': csrfToken,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: JSON.stringify(formData.CheckListHeader),
|
||||
data: JSON.stringify(formData.CheckListHeaderDTO),
|
||||
success: function (response) {
|
||||
if (response.success)
|
||||
{
|
||||
showMessageModal({
|
||||
title: 'Figyelmem!',
|
||||
message: 'Sikeres mentés.',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
showMessageModal({
|
||||
title: 'Figyelmem, HIBA!',
|
||||
message: 'Sikertelen mentés.',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Hiba esetén
|
||||
|
||||
+24
-2
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Serilog;
|
||||
using System.Globalization;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
@@ -32,6 +33,27 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
CheckStatus = _checkListService.GetCheckStatus();
|
||||
BuildCheckListHeaderInfo();
|
||||
}
|
||||
public async Task<IActionResult> OnPostSave([FromBody] CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await _checkListService.UpdateCheckListHeader(checkListHeaderDTO);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return new JsonResult(new { success = true });
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new { success = false });
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
|
||||
return new JsonResult(new { success = false });
|
||||
}
|
||||
private void BuildCheckListHeaderInfo()
|
||||
{
|
||||
CheckListHeaderInfoDTO = new CheckListHeaderInfoDTO();
|
||||
@@ -52,7 +74,7 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
CheckListHeaderInfoDTO.EmptyAnswerCount = result.EmptyAnswerCount;
|
||||
if (CheckListHeaderInfoDTO.TotalRowCount > 0)
|
||||
{
|
||||
CheckListHeaderInfoDTO.ReadyPercent = ((CheckListHeaderInfoDTO.TotalRowCount - CheckListHeaderInfoDTO.EmptyAnswerCount) / CheckListHeaderInfoDTO.TotalRowCount * 100)
|
||||
CheckListHeaderInfoDTO.ReadyPercent = ((double)(CheckListHeaderInfoDTO.TotalRowCount - CheckListHeaderInfoDTO.EmptyAnswerCount) / CheckListHeaderInfoDTO.TotalRowCount * 100)
|
||||
.ToString("0.00", new CultureInfo("hu-HU")) + " %"; ;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +86,7 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
{
|
||||
foreach (var item in CheckListHeaderDTO.CheckListRowDTO)
|
||||
{
|
||||
if (item.CheckListTemplateRowDTO?.AnswerType == "P")
|
||||
if (item.CheckListTemplateRowDTO?.AnswerType == "P" || item.CheckListTemplateRowDTO?.AnswerType == "PN")
|
||||
{
|
||||
if (item.Photo != null && item.Photo.Length > 0)
|
||||
{
|
||||
|
||||
+45
-2
@@ -47,7 +47,7 @@
|
||||
{ data: "shortName" },
|
||||
{ data: "description" },
|
||||
{ data: null, render: function (data, type, row) {
|
||||
return renderActionButtons(row.id);
|
||||
return renderActionButtonsforCheckListTemplateHeader(row.id);
|
||||
}}
|
||||
],
|
||||
columnDefs: [
|
||||
@@ -68,16 +68,59 @@
|
||||
|
||||
$('#newCheckListTemplateHeaderBtn').on('click', function ()
|
||||
{
|
||||
console.log('New button clicked!"');
|
||||
window.location.href = `@Url.Page("./CheckListTemplateHeaderEditPage")?id=0`;
|
||||
});
|
||||
|
||||
|
||||
$('#tbCheckListTemplateHeadersPage').on('click', '.edit-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
window.location.href = `@Url.Page("./CheckListTemplateHeaderEditPage")?id=${row.id}`;
|
||||
});
|
||||
|
||||
$('#tbCheckListTemplateHeadersPage').on('click', '.clone-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
const url = './CheckListTemplateHeaderPage?handler=CloneCheckListTemplateHeader';
|
||||
showConfirmModal({
|
||||
title: 'Klónozás megerősítése',
|
||||
message: 'Biztosan klónozni szeretnéd ezt az elemet?',
|
||||
okText: 'Klónozás',
|
||||
cancelText: 'Mégsem'
|
||||
}).then(function (result) {
|
||||
if (result === 'ok') {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
data: { id: row.id },
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
showMessageModal({
|
||||
title: 'Információ',
|
||||
message: 'A klónozás sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
table.ajax.reload();
|
||||
} else {
|
||||
showMessageModal({
|
||||
title: 'Hiba!',
|
||||
message: 'A klónozás NEM sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
showMessageModal({
|
||||
title: 'Hiba!',
|
||||
message: 'A klónozás NEM sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#tbCheckListTemplateHeadersPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
|
||||
+5
@@ -27,5 +27,10 @@ namespace WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateHeader
|
||||
var isSuccess = await _checkListService.DeleteCheckListTemplateHeader(id);
|
||||
return new JsonResult(new { result = isSuccess });
|
||||
}
|
||||
public async Task<JsonResult> OnGetCloneCheckListTemplateHeader(int id)
|
||||
{
|
||||
var isSuccess = await _checkListService.CloneCheckListTemplateHeader(id);
|
||||
return new JsonResult(new { result = isSuccess });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
@page
|
||||
@model PrivacyModel
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
ViewData["Title"] = "Adatvédelmi tájékoztató";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
||||
<p>Ez az adatvédelmi tájékoztató bemutatja, hogy az oldal hogyan kezeli a felhasználók személyes adatait.</p>
|
||||
|
||||
<h2>Gyűjtött adatok</h2>
|
||||
<ul>
|
||||
<li>Felhasználó neve</li>
|
||||
<li>Felhasználó e-mail címe</li>
|
||||
<li>Bejelentkezési azonosító (JWT token a böngésző cookie-jában tárolva)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Adatok felhasználása</h2>
|
||||
<p>Az adatokat kizárólag a felhasználói fiók azonosítására és a szolgáltatás használatának biztosítására használjuk fel. Az e-mail címet például a fiók kezelésére, valamint a bejelentkezéshez és az azonosításhoz használjuk.</p>
|
||||
|
||||
<h2>Adatok megőrzése</h2>
|
||||
<p>A személyes adatokat a fiók fennállásáig, illetve a törlési kérelem beérkezéséig tároljuk. A JWT token a cookie-ban tárolódik, és annak érvényességi ideje alatt használatos.</p>
|
||||
|
||||
<h2>Adatok továbbítása</h2>
|
||||
<p>Az adatokat harmadik fél számára nem adjuk át, kivéve jogszabályi kötelezettség esetén.</p>
|
||||
|
||||
<h2>Cookie-k</h2>
|
||||
<p>Oldalunk cookie-kat használ a bejelentkezési állapot megőrzése érdekében (JWT token). Ezek szükségesek a szolgáltatás megfelelő működéséhez. A cookie a böngésző bezárása után vagy a lejárati idő eltelte után automatikusan érvénytelenné válik.</p>
|
||||
|
||||
<h2>Felhasználói jogok</h2>
|
||||
<p>A felhasználóknak joguk van tájékoztatást kérni a kezelt adataikról, kérhetik azok helyesbítését vagy törlését, valamint tiltakozhatnak az adatkezelés ellen a jogszabályi keretek között.</p>
|
||||
|
||||
<p>Amennyiben kérdése van az adatkezeléssel kapcsolatban, kérjük, vegye fel velünk a kapcsolatot.</p>
|
||||
|
||||
@@ -67,9 +67,7 @@
|
||||
<li><a class="dropdown-item" asp-area="" asp-page="/UserAndRole/RoleCheckPointsPage">Szabályok - Ellenőrzési pontok</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item dropdown">
|
||||
@@ -87,6 +85,10 @@
|
||||
Jelszó módosítása
|
||||
</a>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li> <!-- EZ AZ ELVÁLASZTÓ VONAL -->
|
||||
<li class="dropdown-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Adatvédelmi tájékoztatás</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -182,7 +184,7 @@
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© @(DateTime.Now.Year) - Workflow Check App - Version @(SystemHelper.ProgramVersion) (@(SystemHelper.DatabaseName))<a asp-area="" asp-page="/Privacy">Privacy</a>
|
||||
© @(DateTime.Now.Year) - Workflow Check App - Version @(SystemHelper.ProgramVersion) (@(SystemHelper.DatabaseName))<a asp-area="" asp-page="/Privacy"> Adatvédelmi tájékoztatás</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@using Microsoft.AspNetCore.Antiforgery
|
||||
@inject IAntiforgery Antiforgery
|
||||
@{
|
||||
ViewData["Title"] = "Ellenőrzési pont";
|
||||
ViewData["Title"] = "Szabály - ellenőrzési sablon";
|
||||
var RoleCheckListTemplateHeaderId = Model.RoleCheckListTemplateHeaderDTO.Id;
|
||||
var urlPost = Url.Page("./RoleCheckListTemplateHeaderEditPage", "Save");
|
||||
}
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Role name</th>
|
||||
<th>Template name</th>
|
||||
<th>Enabled</th>
|
||||
<th>Szabály neve</th>
|
||||
<th>Ellenőrzési sablon neve</th>
|
||||
<th>Engedélyezve?</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Role name</th>
|
||||
<th>Template name</th>
|
||||
<th>Enabled</th>
|
||||
<th>Szabály neve</th>
|
||||
<th>Ellenőrzési sablon neve</th>
|
||||
<th>Engedélyezve?</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@@ -90,17 +90,7 @@
|
||||
$('#tbRoleCheckListTemplateHeadersPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
console.log(row);
|
||||
showConfirmModal({
|
||||
title: 'Törlés megerősítése',
|
||||
message: 'Biztosan törölni szeretnéd ezt az elemet?',
|
||||
okText: 'Törlés',
|
||||
cancelText: 'Mégsem'
|
||||
}).then(function(result) {
|
||||
if(result === 'ok') {
|
||||
console.log('Törlés végrehajtva');
|
||||
}
|
||||
});
|
||||
deleteEntity(table, '/UserAndRole/RoleCheckListTemplateHeadersPage?handler=DeleteRoleCheckListTemplateHeader', row.id);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -21,5 +21,10 @@ namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
var results = await _userService.GetAllRoleCheckListTemplates();
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
public async Task<JsonResult> OnGetDeleteRoleCheckListTemplateHeader(int id)
|
||||
{
|
||||
var isSuccess = await _userService.DeleteRoleCheckListTemplateHeader(id);
|
||||
return new JsonResult(new { result = isSuccess });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@using Microsoft.AspNetCore.Antiforgery
|
||||
@inject IAntiforgery Antiforgery
|
||||
@{
|
||||
ViewData["Title"] = "Ellenőrzési pont";
|
||||
ViewData["Title"] = "Szabály - Ellenőrzési pont";
|
||||
var RoleCheckPointId = Model.RoleCheckPointDTO.Id;
|
||||
var urlPost = Url.Page("./RoleCheckPointEditPage", "Save");
|
||||
}
|
||||
@@ -97,6 +97,8 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
const $form = $("#RoleCheckPointForm");
|
||||
|
||||
|
||||
@@ -71,5 +71,6 @@ namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
this.RoleCheckPoints.Add(new SelectListItem() { Value = CheckPoint.Id.ToString(), Text = CheckPoint.ShortName });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@using WorkFlowCheck.Common.Helper
|
||||
@using WorkFlowCheck.Common.DTO
|
||||
@{
|
||||
ViewData["Title"] = "Szabályok - Ellenőrzési sablonok";
|
||||
ViewData["Title"] = "Szabályok - Ellenőrzési pontok";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>>@DisplayNameHelper.GetDisplayName(nameof(RoleCheckPointDTO.RoleDTO.RoleName), typeof(RoleCheckPointDTO))</th>
|
||||
<th>@DisplayNameHelper.GetDisplayName(nameof(RoleCheckPointDTO.CheckPointDTO.ShortName), typeof(RoleCheckPointDTO))</th>
|
||||
<th>Szabály @DisplayNameHelper.GetDisplayName(nameof(RoleDTO.RoleName), typeof(RoleDTO))</th>
|
||||
<th>Ellenőrzési pont @DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
||||
<th>@DisplayNameHelper.GetDisplayName(nameof(RoleCheckPointDTO.Enabled), typeof(RoleCheckPointDTO))</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
@@ -26,8 +26,8 @@
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>>@DisplayNameHelper.GetDisplayName(nameof(RoleCheckPointDTO.RoleDTO.RoleName), typeof(RoleCheckPointDTO))</th>
|
||||
<th>@DisplayNameHelper.GetDisplayName(nameof(RoleCheckPointDTO.CheckPointDTO.ShortName), typeof(RoleCheckPointDTO))</th>
|
||||
<th>Szabály @DisplayNameHelper.GetDisplayName(nameof(RoleDTO.RoleName), typeof(RoleDTO))</th>
|
||||
<th>Ellenőrzési pont @DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
||||
<th>@DisplayNameHelper.GetDisplayName(nameof(RoleCheckPointDTO.Enabled), typeof(RoleCheckPointDTO))</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
@@ -92,17 +92,7 @@
|
||||
$('#tbRoleCheckPointsPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
console.log(row);
|
||||
showConfirmModal({
|
||||
title: 'Törlés megerősítése',
|
||||
message: 'Biztosan törölni szeretnéd ezt az elemet?',
|
||||
okText: 'Törlés',
|
||||
cancelText: 'Mégsem'
|
||||
}).then(function(result) {
|
||||
if(result === 'ok') {
|
||||
console.log('Törlés végrehajtva');
|
||||
}
|
||||
});
|
||||
deleteEntity(table, '/UserAndRole/RoleCheckPointsPage?handler=DeleteRoleCheckPoint', row.id);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -21,5 +21,10 @@ namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
var results = await _userService.GetAllRoleCheckPoints();
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
public async Task<JsonResult> OnGetDeleteRoleCheckPoint(int id)
|
||||
{
|
||||
var isSuccess = await _userService.DeleteRoleCheckPoint(id);
|
||||
return new JsonResult(new { result = isSuccess });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@using Microsoft.AspNetCore.Antiforgery
|
||||
@inject IAntiforgery Antiforgery
|
||||
@{
|
||||
ViewData["Title"] = "Ellenőrzési pont";
|
||||
ViewData["Title"] = "Szabály szerkesztése";
|
||||
var RoleId = Model.RoleDTO.Id;
|
||||
var urlPost = Url.Page("./RoleEditPage", "Save");
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
$('#tbRolesPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
deleteEntity(table, '/UserAndRole/UserRole?handler=DeleteUser', row.id);
|
||||
deleteEntity(table, '/UserAndRole/RolePage?handler=DeleteRole', row.id);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -21,29 +21,45 @@
|
||||
<input type="hidden" asp-for="UserDTO.Id" />
|
||||
<input type="hidden" asp-for="UserDTO.Password" value="" />
|
||||
|
||||
<input type="hidden" asp-for="UserDTO.NFCCode" value="" />
|
||||
|
||||
<input type="hidden" asp-for="UserDTO.JwtToken" value="" />
|
||||
<input type="hidden" asp-for="UserDTO.RoleDTO" value="" />
|
||||
@if (Model.UserDTO.Id == 0)
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label asp-for="UserDTO.UserName"></label>
|
||||
<input asp-for="UserDTO.UserName" class="form-control" />
|
||||
<input asp-for="UserDTO.UserName" class="form-control" autocomplete="off" />
|
||||
<span asp-validation-for="UserDTO.UserName" class="text-danger"></span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label asp-for="UserDTO.UserName"></label>
|
||||
<input asp-for="UserDTO.UserName" class="form-control" readonly />
|
||||
<span asp-validation-for="UserDTO.UserName" class="text-danger"></span>
|
||||
</div>
|
||||
}
|
||||
@if (Model.UserDTO.Id == 0)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="mb-6">
|
||||
<label asp-for="UserDTO.Password"></label>
|
||||
<input asp-for="UserDTO.Password" class="form-control" type="password" />
|
||||
<span asp-validation-for="UserDTO.Password" class="text-danger"></span>
|
||||
<div class="mb-3">
|
||||
<label asp-for="UserDTO.Password" class="form-label"></label>
|
||||
<div class="input-group">
|
||||
<input asp-for="UserDTO.Password" class="form-control" type="password" id="passwordInput" autocomplete="off" />
|
||||
<button class="btn btn-outline-secondary" type="button" onclick="togglePasswordVisibility()" tabindex="-1">
|
||||
<i class="bi bi-eye" id="toggleIcon"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mb-6">
|
||||
<label asp-for="UserDTO.NFCCode"></label>
|
||||
<input asp-for="UserDTO.NFCCode" class="form-control" type="password" />
|
||||
<span asp-validation-for="UserDTO.NFCCode" class="text-danger"></span>
|
||||
<span asp-validation-for="UserDTO.Password" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="mb-3">
|
||||
<label asp-for="UserDTO.NFCCode"></label>
|
||||
<input asp-for="UserDTO.NFCCode" class="form-control" />
|
||||
<span asp-validation-for="UserDTO.NFCCode" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label asp-for="UserDTO.Email"></label>
|
||||
<input asp-for="UserDTO.Email" class="form-control" />
|
||||
@@ -78,8 +94,10 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<br></br>
|
||||
<div class="card shadow p-4">
|
||||
@if (Model.UserDTO.Id != 0)
|
||||
{
|
||||
<br></br>
|
||||
<div class="card shadow p-4">
|
||||
<table id="tbUserPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
@@ -106,7 +124,8 @@
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@section Scripts {
|
||||
<script>
|
||||
|
||||
@@ -189,6 +208,7 @@
|
||||
const $form = $('#UserForm');
|
||||
|
||||
formData.UserDTO.RoleDTO=[];
|
||||
formData.UserDTO.JwtToken='';
|
||||
formData.UserDTO.Active = $('#UserForm input[name="UserDTO.Active"]').is(':checked');
|
||||
formData.UserDTO.NFCActive = $('#UserForm input[name="UserDTO.NFCActive"]').is(':checked');
|
||||
|
||||
|
||||
@@ -22,9 +22,18 @@ namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
}
|
||||
|
||||
public async Task OnGet(int id)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
UserDTO = new UserDTO();
|
||||
}
|
||||
else
|
||||
{
|
||||
UserDTO = await _userService.GetUser(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> OnPostSave([FromBody] UserDTO userDTO)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -78,17 +78,7 @@
|
||||
$('#tbUserRolesPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
console.log(row);
|
||||
showConfirmModal({
|
||||
title: 'Törlés megerősítése',
|
||||
message: 'Biztosan törölni szeretnéd ezt az elemet?',
|
||||
okText: 'Törlés',
|
||||
cancelText: 'Mégsem'
|
||||
}).then(function(result) {
|
||||
if(result === 'ok') {
|
||||
console.log('Törlés végrehajtva');
|
||||
}
|
||||
});
|
||||
deleteEntity(table, '/UserAndRole/UserRolePage?handler=DeleteUserRole', row.id);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -21,5 +21,10 @@ namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
var results = await _userService.GetAllUserRoles();
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
public async Task<JsonResult> OnGetDeleteUserRole(int id)
|
||||
{
|
||||
var results = await _userService.DeleteUserRole(id);
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
@using WorkFlowCheck.Web.Helpers
|
||||
@namespace WorkFlowCheck.Web.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@addTagHelper *, WorkFlowCheck.Web.Helpers
|
||||
|
||||
@@ -58,7 +58,34 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<ApiResponseDTO<CheckListHeaderDTO>> UpdateCheckListHeader(CheckListHeaderDTO checkListHeaderDTO) => throw new NotImplementedException();
|
||||
public async Task<ApiResponseDTO<CheckListHeaderDTO>> UpdateCheckListHeader(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
try
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/CheckList/UpdateCheckListHeader";
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, checkListHeaderDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
var jsonString = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var response = JsonConvert.DeserializeObject<ApiResponseDTO<CheckListHeaderDTO>>(jsonString);
|
||||
|
||||
return response ?? new ApiResponseDTO<CheckListHeaderDTO>
|
||||
{
|
||||
IsSuccess = false,
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Hiba visszaadása
|
||||
return new ApiResponseDTO<CheckListHeaderDTO>
|
||||
{
|
||||
IsSuccess = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ApiResponseDTO<bool>> AcceptCheckListHeader(int id, int userid)
|
||||
{
|
||||
@@ -264,6 +291,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> CloneCheckListTemplateHeader(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/CheckList/CloneCheckListTemplateHeader/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
public async Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id)
|
||||
|
||||
@@ -19,9 +19,11 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateHeaderAsync();
|
||||
Task<ApiResponseDTO<CheckListTemplateHeaderDTO>> UpdateCheckListTemplateHeader(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
|
||||
Task<bool> DeleteCheckListTemplateHeader(int id);
|
||||
Task<bool> CloneCheckListTemplateHeader(int id);
|
||||
|
||||
Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id);
|
||||
Task<bool> DeleteCheckListTemplateRow(int id);
|
||||
|
||||
Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow(CheckListTemplateRowDTO checkListTemplateRowDTO);
|
||||
|
||||
|
||||
|
||||
@@ -21,14 +21,16 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<UserRoleDTO> GetUserRole(int id);
|
||||
Task<List<UserRoleDTO>> GetAllUserRoles();
|
||||
Task<ApiResponseDTO<UserRoleDTO>> UpdateUserRole(UserRoleDTO userRoleDTO);
|
||||
|
||||
Task<bool> DeleteUserRole(int id);
|
||||
|
||||
Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeader(int id);
|
||||
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplates();
|
||||
Task<ApiResponseDTO<RoleCheckListTemplateHeaderDTO>> UpdateRoleCheckListTemplateHeader(RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO);
|
||||
Task<bool> DeleteRoleCheckListTemplateHeader(int id);
|
||||
|
||||
Task<RoleCheckPointDTO> GetRoleCheckPoint(int id);
|
||||
Task<List<RoleCheckPointDTO>> GetAllRoleCheckPoints();
|
||||
Task<ApiResponseDTO<RoleCheckPointDTO>> UpdateRoleCheckPoint(RoleCheckPointDTO roleCheckPointDTO);
|
||||
Task<bool> DeleteRoleCheckPoint(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,12 @@ namespace WorkFlowCheck.Web.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/updateUser";
|
||||
if (userDTO.Id != null)
|
||||
{
|
||||
userDTO.Password = "xXyY3456!!!;;"; // Ez csak amiatt kell, hogy ne szálljon el a JSON
|
||||
}
|
||||
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/UpdateUser";
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, userDTO))
|
||||
{
|
||||
@@ -421,6 +426,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<bool> DeleteUserRole(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteUserRole/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeader(int id)
|
||||
{
|
||||
@@ -492,6 +518,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<bool> DeleteRoleCheckListTemplateHeader(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteRoleCheckListTemplateHeader/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<RoleCheckPointDTO> GetRoleCheckPoint(int id)
|
||||
{
|
||||
@@ -563,6 +610,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<bool> DeleteRoleCheckPoint(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteRoleCheckPoint/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,23 +2,42 @@
|
||||
// for details on configuring this project to bundle and minify static web assets.
|
||||
|
||||
// Write your JavaScript code.
|
||||
function parseValue(value, type = "string") {
|
||||
if (type === "string") {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (value === "") return null;
|
||||
|
||||
// Boolean
|
||||
if (value.toLowerCase() === "true") return true;
|
||||
if (value.toLowerCase() === "false") return false;
|
||||
|
||||
// Number
|
||||
if (!isNaN(value) && value.trim() !== "") return Number(value);
|
||||
|
||||
// ISO dátum formátum felismerése (alap logika)
|
||||
if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(value)) return new Date(value).toISOString();
|
||||
|
||||
return value;
|
||||
}
|
||||
function getFormAsNestedObject(formSelector) {
|
||||
var formArray = $(formSelector).serializeArray();
|
||||
var result = {};
|
||||
|
||||
formArray.forEach(function (item) {
|
||||
var keys = item.name.split('.');
|
||||
var value = item.value;
|
||||
var inputElement = document.querySelector(`[name="${item.name}"]`);
|
||||
var type = inputElement?.dataset?.type || "string"; // ha nincs data-type, alap: string
|
||||
var value = parseValue(item.value, type);
|
||||
var current = result;
|
||||
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
|
||||
// Ha utolsó kulcs, értéket rendelünk hozzá
|
||||
if (i === keys.length - 1) {
|
||||
current[key] = value;
|
||||
} else {
|
||||
// Ha a következő szint nincs meg, hozzuk létre
|
||||
if (!current[key]) {
|
||||
current[key] = {};
|
||||
}
|
||||
@@ -29,6 +48,7 @@ function getFormAsNestedObject(formSelector) {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function showConfirmModal(options) {
|
||||
return new Promise(function (resolve) {
|
||||
// Alapértelmezett értékek
|
||||
@@ -232,6 +252,19 @@ function renderActionButtonsforCheckListHeader(data, rowId) {
|
||||
//</button>`;
|
||||
|
||||
}
|
||||
function renderActionButtonsforCheckListTemplateHeader(rowId) {
|
||||
return `
|
||||
<button class="btn btn-primary edit-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi-pencil-fill"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger delete-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi-trash-fill"></i>
|
||||
</button>
|
||||
<button class="btn btn-primary clone-btn btn-sm" data-id="${rowId}">
|
||||
<i class="bi bi bi-copy"></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
function renderCheckStatus(data) {
|
||||
//Open = 0,
|
||||
@@ -407,3 +440,17 @@ function saveEntity(csrfToken, data, url) {
|
||||
}
|
||||
});
|
||||
}
|
||||
function togglePasswordVisibility() {
|
||||
const passwordInput = document.getElementById("passwordInput");
|
||||
const icon = document.getElementById("toggleIcon");
|
||||
|
||||
if (passwordInput.type === "password") {
|
||||
passwordInput.type = "text";
|
||||
icon.classList.remove("bi-eye");
|
||||
icon.classList.add("bi-eye-slash");
|
||||
} else {
|
||||
passwordInput.type = "password";
|
||||
icon.classList.remove("bi-eye-slash");
|
||||
icon.classList.add("bi-eye");
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlowCheck.BL", "WorkFlo
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlowCheck.Common", "WorkFlowCheck.Common\WorkFlowCheck.Common.csproj", "{CBB000AD-E96B-4A4E-A037-4650EFECBB11}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlowCheck.Web", "WorkFlowCheck.Web\WorkFlowCheck.Web.csproj", "{F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -47,6 +49,10 @@ Global
|
||||
{CBB000AD-E96B-4A4E-A037-4650EFECBB11}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CBB000AD-E96B-4A4E-A037-4650EFECBB11}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CBB000AD-E96B-4A4E-A037-4650EFECBB11}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F4D05A26-A90F-6E65-8C1F-24D98D6F3AA0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user