using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection.Emit; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Xml; using Telerik.Windows.Input.Touch; namespace eDosStation { /// /// Interaction logic for UserInfo.xaml /// public partial class UserInfo : Window { int PersID; DataTable dsInfo; DataSet1.GetPersonOverviewRow rw; public UserInfo(int persid) { InitializeComponent(); PersID = 12925; } private void cmdOK_Click(object sender, RoutedEventArgs e) { this.Close(); } private void Window_Loaded(object sender, RoutedEventArgs e) { GridLength glz = new GridLength(0); rw = null; using (var ta = new DataSet1TableAdapters.GetPersonOverviewTableAdapter()) { dsInfo = ta.GetData(PersID); if (dsInfo != null && dsInfo.Rows.Count > 0) rw = dsInfo.Rows[0] as DataSet1.GetPersonOverviewRow; } if (rw != null) { LastName.Text = rw.LastName; FirstName.Text = rw.FirstName; Type.Text = rw.Type; MarginHP10_Y.Text = rw.MarginHP10_Y.ToString() + " µSv"; if (rw.VisitIDLocked > 0) VisitLocked.Text = rw.VisitIDLocked.ToString(); else VisitLocked.Text = string.Empty; if (!rw.IsAccessAllowNull()) AccessAllow.Text = rw.AccessAllow ? "OK" : "Not ok"; else AccessAllow.Text = "No access"; Comment.Text = rw.ReasonNoAccess; if (!rw.IsinfoNull()) { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(rw.info); var nl = xmlDocument.SelectSingleNode("Info[1]") as XmlElement; QuizDate.Text = XmlConvert.ToDateTime(nl.GetAttribute("QuizDate"), XmlDateTimeSerializationMode.Local).ToString("yyyy-MM-dd"); QuizExpiry.Text = nl.GetAttribute("QuizExpiry"); MedicExpiry.Text = nl.GetAttribute("MedicExpiry"); InVivoWbcExpiry.Text = nl.GetAttribute("InVivoWbcExpiry"); InVitroExpiry.Text = nl.GetAttribute("InVitroExpiry"); RFStart.Text = nl.GetAttribute("RFStart"); RFEnd.Text = nl.GetAttribute("RFEnd"); BadgeColor.Text = nl.GetAttribute("badgeColor"); QuizOK.Text = nl.GetAttribute("QuizOK").Equals("1") ? "OK" : "Niet ok"; MedicOK.Text = nl.GetAttribute("MedicOK").Equals("1") ? "OK" : "Niet ok"; bool BunkerReq = XmlConvert.ToBoolean(nl.GetAttribute("InVivoReq")); int r = Grid.GetRow(InVivoWbcFreq); RowDefinition rowDef = G1.RowDefinitions[r]; rowDef.Height = BunkerReq ? GridLength.Auto : glz; InVivoWbcFreq.Text = nl.GetAttribute("InVivoWbcFreq"); InVivoOK.Text = nl.GetAttribute("InVivoOK"); bool LRMReq = XmlConvert.ToBoolean(nl.GetAttribute("InVitroReq")); r = Grid.GetRow(InVitroFreq); rowDef = G1.RowDefinitions[r]; rowDef.Height = LRMReq ? GridLength.Auto : glz; InVitroFreq.Text = nl.GetAttribute("InVitroFreq"); InVitroOK.Text = nl.GetAttribute("InVitroOK"); VxExpiry.Text = nl.GetAttribute("VxExpiry"); VxColor.Text = nl.GetAttribute("VxColor"); } else { QuizDate.Text = string.Empty; QuizExpiry.Text = string.Empty; MedicExpiry.Text = string.Empty; RFStart.Text = string.Empty; RFEnd.Text = string.Empty; BadgeColor.Text = string.Empty; QuizOK.Text = string.Empty; MedicOK.Text = string.Empty; int r = Grid.GetRow(InVivoWbcFreq); RowDefinition rowDef = G1.RowDefinitions[r]; rowDef.Height = glz; r = Grid.GetRow(InVitroFreq); rowDef = G1.RowDefinitions[r]; rowDef.Height = glz; VxExpiry.Text = string.Empty; VxColor.Text = string.Empty; } } } } }