private void Load() { DataAccess db = new DataAccess(); abi = db.GetABI(Id); aec = db.GetAEC(Id); ahi = db.GetAHI(Id); ap = db.GetAP(Id); aci = db.GetACI(Id); BasicInfoField.DataContext = abi; EmergencyContactField.DataContext = aec; HealthInformationField.DataContext = ahi; StudentPolicyField.DataContext = ap; ConfidentialInfoField.DataContext = aci; if (ahi.healthSignature != null) { using (MemoryStream ms = new MemoryStream(ahi.healthSignature)) { HISignatureCanvas.Strokes = new System.Windows.Ink.StrokeCollection(ms); ms.Close(); } } if (ap.studentSignature != null) { using (MemoryStream ms = new MemoryStream(ap.studentSignature)) { policySignatureCanvas.Strokes = new System.Windows.Ink.StrokeCollection(ms); ms.Close(); } } }
public void SaveACI(AdultConfidentialInfoClass aci) { using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(Helper.CnnVal("EnrollmentDB"))) { connection.Execute($"Update AdultConfidentialInfo Set formCompletionDate = @FormCompletionDate, foodStamps = @FoodStamps, dependentChildrenAid = @DependentChildrenAid, supplementaryIncome = @SupplementaryIncome, housingAssistance = @HousingAssistance, none = @None, homeless = @Homeless, agedOutFosterCare = @AgedOutFosterCare, outOfWorkforce = @OutOfWorkforce Where Id = @id", new { FormCompletionDate = aci.formCompletionDate, FoodStamps = aci.foodStamps, DependentChildrenAid = aci.dependentChildrenAid, SupplementaryIncome = aci.supplementaryIncome, HousingAssistance = aci.housingAssistance, None = aci.none, Homeless = aci.homeless, AgedOutFosterCare = aci.agedOutFosterCare, OutOfWorkforce = aci.outOfWorkforce, id = aci.Id }); connection.Execute($"Update AdultLogins Set submitted = @Submitted, dateSubmitted = @DateSubmitted Where Id = @id", new { Submitted = "Yes", DateSubmitted = DateTime.Now, id = aci.Id }); } }
public AdultConfidentialInfoUC() { InitializeComponent(); DataAccess db = new DataAccess(); aci = db.GetACI(LoginPage.adultCheck.Id); // set the datacontext of the text fields textFields.DataContext = aci; }