public void Verify() { UnitOfWork unitOfWork = new UnitOfWork(new bastelei_ws()); if (SelectedProbe != null) { unitOfWork.Probes.VerifyProbeByLocation(SelectedProbe.LocationName); unitOfWork.Complete(); //TODO Information Text } else { //Todo Information nicht erfolgreich } LoadProbes(); }
public void LoadProbes() { try { ProbeList.Clear(); UnitOfWork unitOfWork = new UnitOfWork(new bastelei_ws()); var probes = unitOfWork.Probes.GetUnverifiedProbes(); foreach (UnverifiedProbe item in probes) { ProbeList.Add(item); } unitOfWork.Complete(); } catch { } }
private void GetLocations() { try { if(Locations.Count != 0) { Locations.Clear(); } var unitOfWork = new UnitOfWork(new bastelei_ws()); var locNames = unitOfWork.Probes.GetLocationNames(); foreach (var name in locNames) { Locations.Add(new LocationViewModel(name)); } unitOfWork.Complete(); } catch (Exception ex) { throw new SystemException("Couldn't connect to DB", ex); } }
private void RegisterProbe() { try { var unitOfWork = new UnitOfWork(new bastelei_ws()); if (unitOfWork.Users.MailExists(_mailAddress)) { int uid = unitOfWork.Users.GetUserIDbyMail(_mailAddress); unitOfWork.Probes.AddProbe(uid, LocationName, Comment); unitOfWork.Complete(); Information = "Probe registration successful."; } else { Information = "No Database Connection"; } } catch (Exception ex) { } }
public void Submit() { try { var unitOfWork = new UnitOfWork(new bastelei_ws()); unitOfWork.Probes.ChangeLocationNames(SelectedLocation.LocationBtn, NewLocationName); unitOfWork.Probes.UnverifyProbeByLocation(SelectedLocation.LocationBtn); unitOfWork.Complete(); Information = "Location Name changed. Please wait for varification"; } catch (Exception ex) { throw new SystemException("Couldn't connect to DB", ex); } }
private void RegisterUser() { if(PasswordOne != PasswordTwo) { Information = "Your passwords don't match."; return; } try { var unitOfWork = new UnitOfWork(new bastelei_ws()); if (!unitOfWork.Users.MailExists(MailAdress)) { string encryptedPassword = Tools.EncryptPassword(MailAdress, PasswordOne); unitOfWork.Users.AddUser(Name, Surname, MailAdress, encryptedPassword); unitOfWork.Complete(); TryClose(); } else { Information = "Mail adress does already exist."; } } catch (Exception ex) { } }