|
@@ -13,6 +13,7 @@ using Syncfusion.XForms.SignaturePad;
|
|
|
using comal.timesheets.Tasks;
|
|
|
using Comal.Classes;
|
|
|
using PRSClasses;
|
|
|
+using Newtonsoft.Json;
|
|
|
|
|
|
namespace comal.timesheets.QAForms
|
|
|
{
|
|
@@ -584,95 +585,102 @@ namespace comal.timesheets.QAForms
|
|
|
|
|
|
private Tuple<View, Boolean> LoadOptionPicker(View view, DFLayoutControl element, string value)
|
|
|
{
|
|
|
- var isrequired = false;
|
|
|
-
|
|
|
- DFLayoutOptionField dfLayoutOptionField = element as DFLayoutOptionField;
|
|
|
- isrequired = dfLayoutOptionField.Properties.Required;
|
|
|
- if (GlobalVariables.DeviceString == "i" || GlobalVariables.DeviceString == "I")
|
|
|
+ try
|
|
|
{
|
|
|
- CustomPickeriOS item = new CustomPickeriOS();
|
|
|
- string s = dfLayoutOptionField.Properties.Options;
|
|
|
- string[] substrings = s.Split(',');
|
|
|
- var optionList = substrings.ToList();
|
|
|
- item.AddItems(optionList);
|
|
|
- if (!string.IsNullOrEmpty(dfLayoutOptionField.Properties.Default))
|
|
|
- {
|
|
|
- int index = optionList.IndexOf(dfLayoutOptionField.Properties.Default);
|
|
|
- item.SelectedIndex = index;
|
|
|
- item.SelectedItem = optionList[index];
|
|
|
- item.SetDefault(optionList[index]);
|
|
|
- }
|
|
|
- if (loadData.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
- {
|
|
|
- int index = optionList.IndexOf(value);
|
|
|
- item.SelectedIndex = index;
|
|
|
- item.SelectedItem = optionList[index];
|
|
|
- item.SetDefault(optionList[index]);
|
|
|
- }
|
|
|
- if (loadRetainedForm)
|
|
|
+ var isrequired = false;
|
|
|
+
|
|
|
+ DFLayoutOptionField dfLayoutOptionField = element as DFLayoutOptionField;
|
|
|
+ isrequired = dfLayoutOptionField.Properties.Required;
|
|
|
+ if (GlobalVariables.DeviceString == "i" || GlobalVariables.DeviceString == "I")
|
|
|
{
|
|
|
- if (RetainedResults.Results.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
+ CustomPickeriOS item = new CustomPickeriOS();
|
|
|
+ string s = dfLayoutOptionField.Properties.Options;
|
|
|
+ string[] substrings = s.Split(',');
|
|
|
+ var optionList = substrings.ToList();
|
|
|
+ item.AddItems(optionList);
|
|
|
+ if (!string.IsNullOrEmpty(dfLayoutOptionField.Properties.Default))
|
|
|
+ {
|
|
|
+ int index = optionList.IndexOf(dfLayoutOptionField.Properties.Default);
|
|
|
+ item.SelectedIndex = index;
|
|
|
+ item.SelectedItem = optionList[index];
|
|
|
+ item.SetDefault(optionList[index]);
|
|
|
+ }
|
|
|
+ if (loadData.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
{
|
|
|
int index = optionList.IndexOf(value);
|
|
|
item.SelectedIndex = index;
|
|
|
item.SelectedItem = optionList[index];
|
|
|
item.SetDefault(optionList[index]);
|
|
|
}
|
|
|
+ if (loadRetainedForm)
|
|
|
+ {
|
|
|
+ if (RetainedResults.Results.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
+ {
|
|
|
+ int index = optionList.IndexOf(value);
|
|
|
+ item.SelectedIndex = index;
|
|
|
+ item.SelectedItem = optionList[index];
|
|
|
+ item.SetDefault(optionList[index]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isrequired)
|
|
|
+ {
|
|
|
+ item.BackgroundColor = isRequiredColor;
|
|
|
+ item.SetBackGroundColor(isRequiredColor);
|
|
|
+ }
|
|
|
+ item.CustomPickeriOSValueChanged += () =>
|
|
|
+ {
|
|
|
+ dfLayout.ChangeField(dfLayoutOptionField.Name);
|
|
|
+ };
|
|
|
+ view = item;
|
|
|
}
|
|
|
- if (isrequired)
|
|
|
- {
|
|
|
- item.BackgroundColor = isRequiredColor;
|
|
|
- item.SetBackGroundColor(isRequiredColor);
|
|
|
- }
|
|
|
- item.CustomPickeriOSValueChanged += () =>
|
|
|
- {
|
|
|
- dfLayout.ChangeField(dfLayoutOptionField.Name);
|
|
|
- };
|
|
|
- view = item;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Picker picker = new Picker();
|
|
|
- picker.Title = "Select an option";
|
|
|
- picker.VerticalTextAlignment = TextAlignment.Center;
|
|
|
- picker.HorizontalTextAlignment = TextAlignment.Center;
|
|
|
- string s = dfLayoutOptionField.Properties.Options;
|
|
|
- string[] substrings = s.Split(',');
|
|
|
- var optionList = substrings.ToList();
|
|
|
- picker.ItemsSource = optionList;
|
|
|
- if (!string.IsNullOrEmpty(dfLayoutOptionField.Properties.Default))
|
|
|
- {
|
|
|
- int index = optionList.IndexOf(dfLayoutOptionField.Properties.Default);
|
|
|
- picker.SelectedIndex = index;
|
|
|
- picker.SelectedItem = optionList[index];
|
|
|
- }
|
|
|
- if (loadData.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
- {
|
|
|
- int index = optionList.IndexOf(value);
|
|
|
- picker.SelectedIndex = index;
|
|
|
- picker.SelectedItem = optionList[index];
|
|
|
- }
|
|
|
- if (loadRetainedForm)
|
|
|
+ else
|
|
|
{
|
|
|
- if (RetainedResults.Results.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
+ Picker picker = new Picker();
|
|
|
+ picker.Title = "Select an option";
|
|
|
+ picker.VerticalTextAlignment = TextAlignment.Center;
|
|
|
+ picker.HorizontalTextAlignment = TextAlignment.Center;
|
|
|
+ string s = dfLayoutOptionField.Properties.Options;
|
|
|
+ string[] substrings = s.Split(',');
|
|
|
+ var optionList = substrings.ToList();
|
|
|
+ picker.ItemsSource = optionList;
|
|
|
+ if (!string.IsNullOrEmpty(dfLayoutOptionField.Properties.Default))
|
|
|
+ {
|
|
|
+ int index = optionList.IndexOf(dfLayoutOptionField.Properties.Default);
|
|
|
+ picker.SelectedIndex = index;
|
|
|
+ picker.SelectedItem = optionList[index];
|
|
|
+ }
|
|
|
+ if (loadData.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
{
|
|
|
int index = optionList.IndexOf(value);
|
|
|
picker.SelectedIndex = index;
|
|
|
picker.SelectedItem = optionList[index];
|
|
|
}
|
|
|
+ if (loadRetainedForm)
|
|
|
+ {
|
|
|
+ if (RetainedResults.Results.TryGetValue(dfLayoutOptionField.Name, out value))
|
|
|
+ {
|
|
|
+ int index = optionList.IndexOf(value);
|
|
|
+ picker.SelectedIndex = index;
|
|
|
+ picker.SelectedItem = optionList[index];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isrequired)
|
|
|
+ {
|
|
|
+ picker.BackgroundColor = isRequiredColor;
|
|
|
+ }
|
|
|
+ picker.SelectedIndexChanged += (object sender, EventArgs e) =>
|
|
|
+ {
|
|
|
+ dfLayout.ChangeField(dfLayoutOptionField.Name);
|
|
|
+ };
|
|
|
+ view = picker;
|
|
|
}
|
|
|
- if (isrequired)
|
|
|
- {
|
|
|
- picker.BackgroundColor = isRequiredColor;
|
|
|
- }
|
|
|
- picker.SelectedIndexChanged += (object sender, EventArgs e) =>
|
|
|
- {
|
|
|
- dfLayout.ChangeField(dfLayoutOptionField.Name);
|
|
|
- };
|
|
|
- view = picker;
|
|
|
- }
|
|
|
|
|
|
- return new Tuple<View, Boolean>(view, isrequired);
|
|
|
+ return new Tuple<View, Boolean>(view, isrequired);
|
|
|
+ }
|
|
|
+ catch
|
|
|
+ {
|
|
|
+ return new Tuple<View, Boolean>(view, false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private Tuple<View, Boolean> LoadImage(View view, DFLayoutControl element)
|
|
@@ -2046,7 +2054,7 @@ namespace comal.timesheets.QAForms
|
|
|
|
|
|
public void SetFieldColour(string field, System.Drawing.Color? colour = null)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
#endregion
|
|
|
|