Пример #1
0
 public void LoadRepo()
 {
     try
     {
         ExamensRepository=new XmlRepository<Examen>("exams.config");
         ConfigRepository=new XmlRepository<ModelsLib.Login>("config.xml");
         Examens = new ObservableCollection<Examen>(ExamensRepository.Get());
     }
     catch (Exception e)
     {
         e.SaveException();
     }
 }
Пример #2
0
 private void LoadConfigLogin()
 {
     try
     {
         var confRepo=new XmlRepository<ModelsLib.Login>("config.xml");
         Login = confRepo.Get().FirstOrDefault();
     }
     catch (Exception e)
     {
         e.SaveException();
     }
 }
Пример #3
0
        private void LoadRepos()
        {
            try
            {
                IUnitOfWork ctx = SimpleIoc.Default.GetInstance<OphtalmoContext>();

                ExamensRepository = new Repository<Examen>(ctx);
                ComptesRendusRepository = new Repository<CompteRendu>(ctx);
                MedecinRepository = new Repository<Medecin>(ctx);
                ExamensBasicsRepository = new XmlRepository<Examen>("exams.config");
                ExamenBasics = new ObservableCollection<Examen>(ExamensBasicsRepository.Get().ToList());
                FindMedecin();
            }
            catch (Exception e)
            {
                e.SaveException();
            }
        }
Пример #4
0
 private void GenerateBtn_Click(object sender, RoutedEventArgs e)
 {
     if (UnameBox.Text.Length < 3 || PwdBox.Text.Length < 3)
     {
         MessageBox.Show("Ya el haj ! User or password must contain more then 3 words");
         return;
     }
     var key = "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00";
     if (ActivationChk.IsChecked != null && (bool) ActivationChk.IsChecked)
         key = ToMd5(GetMacAddress());
     var login = new Login
     {
         Id = 0,
         Nom = UnameBox.Text,
         MotDePasse = ToMd5(PwdBox.Text),
         Secret = ToMd5(UnameBox.Text + PwdBox.Text + DateTime.Today.Month + DateTime.Today.Year),
         Serial = key
     };
     var dlg = new SaveFileDialog();
     dlg.FileName = "config.xml";
     dlg.ShowDialog();
     if (File.Exists(dlg.FileName))
         File.Delete(dlg.FileName);
     ConfigRepository = new XmlRepository<ModelsLib.Login>(dlg.FileName);
     ConfigRepository.AddOrUpdate(login);
 }