BUGFIX valu mentésére

This commit is contained in:
2025-07-07 14:57:40 +02:00
parent affad21ab0
commit 24c49567aa
4 changed files with 22 additions and 6 deletions
@@ -19,7 +19,7 @@ namespace WorkFlowCheck.MAUI.Helper
public static string DatabaseName = ""; public static string DatabaseName = "";
public static bool Syncronised = false; public static bool Syncronised = false;
public static UserDTO SystemUserDTO; public static UserDTO SystemUserDTO;
public static string ProgramVersion = "v1.1.038"; public static string ProgramVersion = "v1.1.039";
#if DEBUG #if DEBUG
//public static string ApiBaseUrl = $"http://10.0.2.2:59027/"; //public static string ApiBaseUrl = $"http://10.0.2.2:59027/";
@@ -162,6 +162,7 @@
<Entry Grid.Column="3" <Entry Grid.Column="3"
Text="{Binding Answer}" Text="{Binding Answer}"
HorizontalTextAlignment="Center" HorizontalTextAlignment="Center"
TextChanged="V_Entry_Text_Changed"
VerticalOptions="Center" /> VerticalOptions="Center" />
</Grid> </Grid>
</Frame> </Frame>
@@ -124,14 +124,19 @@ public partial class CheckListWorkPage : ContentPage
if (checkListRowDTO != null) if (checkListRowDTO != null)
{ {
checkListRowDTO.Answer = checkListRowCS.Answer;
if (checkListRowCS.AnswerYes == true) if (checkListRowCS.AnswerYes == true)
{ {
checkListRowDTO.Answer = "Igen"; checkListRowDTO.Answer = "Igen";
} }
if (checkListRowCS.AnswerNo == true) else if (checkListRowCS.AnswerNo == true)
{ {
checkListRowDTO.Answer = "Nem"; checkListRowDTO.Answer = "Nem";
} }
else
{
checkListRowDTO.Answer = checkListRowCS.Answer;
}
await _checkListService.UpdateCheckListRow(checkListRowDTO, withReload); await _checkListService.UpdateCheckListRow(checkListRowDTO, withReload);
} }
} }
@@ -192,7 +197,7 @@ public partial class CheckListWorkPage : ContentPage
var checkListRowDTO = CheckListRowDTOs.FirstOrDefault(w => w.Id == checkListRowCS.Id); var checkListRowDTO = CheckListRowDTOs.FirstOrDefault(w => w.Id == checkListRowCS.Id);
if (checkListRowDTO != null) if (checkListRowDTO != null)
{ {
checkListRowDTO.Photo = checkListRowCS.PhotoBytes; checkListRowDTO.Photo = checkListRowCS.PhotoBytes;
checkListRowDTO.Answer = "Igen"; checkListRowDTO.Answer = "Igen";
await _checkListService.UpdateCheckListRow(checkListRowDTO, true); await _checkListService.UpdateCheckListRow(checkListRowDTO, true);
@@ -249,6 +254,15 @@ public partial class CheckListWorkPage : ContentPage
IsLoading = false; IsLoading = false;
} }
private void V_Entry_Text_Changed(object sender, TextChangedEventArgs e)
{
var entry = sender as Entry;
var model = entry?.BindingContext as CheckListRowCS;
if (model != null)
{
model.Answer = e.NewTextValue;
}
}
} }
public class BindableRadioButton : RadioButton public class BindableRadioButton : RadioButton
{ {
@@ -170,8 +170,8 @@ namespace WorkFlowCheck.MAUI.Services
if (checkListRow.Answer != checkListRowDTO.Answer) if (checkListRow.Answer != checkListRowDTO.Answer)
{ {
checkListRow.Answer = checkListRowDTO.Answer; checkListRow.Answer = checkListRowDTO.Answer;
} }
if (checkListRowDTO.Photo != null && checkListRowDTO.Photo.Length > 0 && withPhoto) if (checkListRowDTO.Photo != null && checkListRowDTO.Photo.Length > 0 && withPhoto)
{ {
if (!checkListRow.Photo.SequenceEqual(checkListRowDTO.Photo ?? Array.Empty<byte>())) if (!checkListRow.Photo.SequenceEqual(checkListRowDTO.Photo ?? Array.Empty<byte>()))
@@ -328,7 +328,8 @@ namespace WorkFlowCheck.MAUI.Services
.Include(i => i.CheckListTemplateRow) .Include(i => i.CheckListTemplateRow)
.ThenInclude(i => i.CheckPoint) .ThenInclude(i => i.CheckPoint)
.Where(w => w.CheckListHeaderId == checkListHeaderDTO.Id .Where(w => w.CheckListHeaderId == checkListHeaderDTO.Id
&& string.IsNullOrEmpty(w.Answer.Trim())) && string.IsNullOrEmpty(w.Answer.Trim())
&& w.CheckListTemplateRow.AnswerType != "PN")
.Select(w => w.CheckListTemplateRow.CheckPoint) .Select(w => w.CheckListTemplateRow.CheckPoint)
.OrderBy(cp => cp.ShortName) .OrderBy(cp => cp.ShortName)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();