public AssigneChambre(Reservations res, GESHOTELEntities Model, string Etat)
        {
            model = Model;
            Res   = res;
            etat  = Etat;

            InitializeComponent();
        }
Esempio n. 2
0
        private void Load()
        {
            model = new GESHOTELEntities();

            var resultat = from res in model.Quartiers
                           where res.Etat == "ACTIF"
                           select res;

            AllData = new ObservableCollection <Quartiers>(resultat.ToList());
        }
        private void UserControl_Loaded_1(object sender, RoutedEventArgs e)
        {
            //GlobalData.Readini();
            //GlobalData.Init();

            model = new GESHOTELEntities();

            Grid ch = this.Parent as Grid;

            EnumVisual(ch, collection);
        }
        public TransactionEdit(int Res, string str)
        {
            InitializeComponent();

            model      = new GESHOTELEntities();
            res        = model.Reservations.Where(c => c.ID == Res).FirstOrDefault();
            PaneHeader = str;

            ClearArticle();
            ClearPaie();
            load();
        }
Esempio n. 5
0
        private void Load()
        {
            model = new GESHOTELEntities();

            var resultat = from res in model.Reservations
                           where res.TypeOperation == "RESERVATION" && res.Etat == "RESERVER"
                           orderby res.ID descending
                           select res;

            AllData = new ObservableCollection <Reservations>(resultat.ToList());

            DateTime t  = DateTime.Now.Date;
            DateTime t1 = DateTime.Now.Add(TimeSpan.FromDays(1)).Date;

            var resultat10 = from res in model.Reservations
                             where res.DateCheckIn != null && res.DateCheckIn >= t && res.DateCheckIn < t1
                             orderby res.ID descending
                             select res;

            ListeArrivees = new ObservableCollection <Reservations>(resultat10.ToList());

            var resultat1 = from res in model.Quartiers
                            where res.Etat == "ACTIF"
                            select res;

            AllQuartiers = new ObservableCollection <Quartiers>(resultat1.ToList());

            var resultat2 = from res in model.Communes
                            where res.Etat == "ACTIF"
                            select res;

            AllCommunes = new ObservableCollection <Communes>(resultat2.ToList());

            var resultat3 = from res in model.Nationalités
                            where res.Etat == "ACTIF"
                            select res;

            AllNationalités = new ObservableCollection <Nationalités>(resultat3.ToList());

            var resultat4 = from res in model.Villes
                            where res.Etat == "ACTIF"
                            select res;

            AllVilles = new ObservableCollection <Villes>(resultat4.ToList());

            var resultat5 = from res in model.Pays
                            where res.Etat == "ACTIF"
                            select res;

            AllPays = new ObservableCollection <Pays>(resultat5.ToList());
        }
Esempio n. 6
0
        private void Load()
        {
            model = new GESHOTELEntities();

            var resultat = from res in model.Chambres
                           where res.Etat == "ACTIF"
                           select res;

            AllData = new ObservableCollection <Chambres>(resultat.ToList());

            var resultat1 = from res in model.TypeChambres
                            where res.Etat == "ACTIF"
                            select res;

            AllTypes = new ObservableCollection <TypeChambres>(resultat1.ToList());
        }
Esempio n. 7
0
        private void Load()
        {
            model = new GESHOTELEntities();
            var resultat = from res in model.Sous_Rubriques
                           where res.Etat == "ACTIF"
                           select res;

            AllData = new ObservableCollection <Sous_Rubriques>(resultat.ToList());

            model = new GESHOTELEntities();
            var resultat1 = from res in model.Rubriques
                            where res.Etat == "ACTIF"
                            select res;

            AllRubriques = new ObservableCollection <Rubriques>(resultat1.ToList());
        }
Esempio n. 8
0
        private void Load()
        {
            try
            {
                model = new GESHOTELEntities();

                //AllTypeChambres = new AutoRefreshWrapper<TypeChambres>(model.ChambreDisponibilite, RefreshMode.StoreWins);
                AllChambres = new ObservableCollection <Chambres>(model.Chambres.Where(c => c.Etat != "SUPPRIMER"));
                AllChambres.OrderBy(p => p.TypeChambres);
            }
            catch (Exception)
            {
                MessageBox.Show("Il y a eu un problem lors de la connection au serveur. \n Veiullez verifier la connection internet");
            }
            //base.RaisePropertyChangedEvent("AllChantiers");
        }
Esempio n. 9
0
        private void Load()
        {
            model = new GESHOTELEntities();

            var resultat = from res in model.Raisons
                           where res.Etat == "ACTIF"
                           select res;

            AllData = new ObservableCollection <Raisons>(resultat.ToList());
            model   = new GESHOTELEntities();

            var resultat1 = from res in model.RaisonType
                            where res.Etat == "ACTIF"
                            select res;

            AllRaisonType = new ObservableCollection <RaisonType>(resultat1.ToList());
        }
        //private void GetReport()
        //{
        //    ObservableCollection<Fichiers> allRapport = new ObservableCollection<Fichiers>();


        //    foreach (var item in Directory.GetFiles(GlobalData.ReportListePath, "*.trdx"))
        //    {
        //        allRapport.Add(new Fichiers(item));
        //    }

        //    lstRapport.ItemsSource = allRapport;

        //    lstRapport.SelectedIndex = -1;
        //}

        private void GetReport()
        {
            GESHOTELEntities model = new GESHOTELEntities();

            List <Permissions> uti = GlobalData.CurrentUser.Permissions.Where(c => c.EstRapport == true).ToList();

            ObservableCollection <Fichiers> allRapport = new ObservableCollection <Fichiers>();

            foreach (var item in uti)
            {
                allRapport.Add(new Fichiers(item.Path, item.DisplayName));
            }

            lstRapport.ItemsSource = allRapport;

            lstRapport.SelectedIndex = -1;
        }
Esempio n. 11
0
        public InsertData(string etat, TypeChambres ele, TypeChambresViewModel view)
        {
            InitializeComponent();

            this.DataContext = viewVM = view;
            GESHOTELEntities model = new GESHOTELEntities();
            var query = from res in model.Amenities where res.Etat == "ACTIF" select res.Libelle;

            comboBox.ItemsSource = query.ToList();
            Etat = etat;

            if (etat == "AJOUT")
            {
                this.Title = "Enregistrement d'un Quartier";
            }
            else
            {
                this.Title = "Modification d'un Quartier";
            }
        }
Esempio n. 12
0
        private void Load()
        {
            try
            {
                if (model == null)
                {
                    model = new GESHOTELEntities();
                }


                GetReservationStat();
                GetChambreStat();
                LoadDepense();
            }
            catch (Exception)
            {
                MessageBox.Show("Il y a eu un problem lors de la connection au serveur. \n Veiullez verifier la connection internet");
            }
            //base.RaisePropertyChangedEvent("AllChantiers");
        }
Esempio n. 13
0
        private void Load()
        {
            model = new GESHOTELEntities();

            var resultat = from res in model.Clients
                           where res.Etat == "ACTIF"
                           select res;

            AllData = new ObservableCollection <Clients>(resultat.ToList());

            var resultat1 = from res in model.Quartiers
                            where res.Etat == "ACTIF"
                            select res;

            AllQuartiers = new ObservableCollection <Quartiers>(resultat1.ToList());

            var resultat2 = from res in model.Communes
                            where res.Etat == "ACTIF"
                            select res;

            AllCommunes = new ObservableCollection <Communes>(resultat2.ToList());

            var resultat3 = from res in model.Nationalités
                            where res.Etat == "ACTIF"
                            select res;

            AllNationalités = new ObservableCollection <Nationalités>(resultat3.ToList());

            var resultat4 = from res in model.Villes
                            where res.Etat == "ACTIF"
                            select res;

            AllVilles = new ObservableCollection <Villes>(resultat4.ToList());

            var resultat5 = from res in model.Pays
                            where res.Etat == "ACTIF"
                            select res;

            AllPays = new ObservableCollection <Pays>(resultat5.ToList());
        }
Esempio n. 14
0
        private void Load()
        {
            model = new GESHOTELEntities();
            var resultat = from res in model.Produits
                           where res.Etat == "ACTIF"
                           select res;

            AllData = new ObservableCollection <Produits>(resultat.ToList());

            model = new GESHOTELEntities();
            var resultat1 = from res in model.Categories
                            where res.Etat == "ACTIF"
                            select res;

            AllCategories = new ObservableCollection <Categories>(resultat1.ToList());

            model = new GESHOTELEntities();
            var resultat2 = from res in model.Conditionnements
                            where res.Etat == "ACTIF"
                            select res;

            AllConditionnements = new ObservableCollection <Conditionnements>(resultat2.ToList());
        }
Esempio n. 15
0
 public ClientsViewModel(GESHOTELEntities Model)
 {
     model = Model;
     Refresh();
 }
Esempio n. 16
0
        private void btnValider_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ProduitsViewModel vm  = this.DataContext as ProduitsViewModel;
                Produits          ent = vm.SelectedData;

                if (Etat == "AJOUT")
                {
                    try
                    {
                        GESHOTELEntities context = new GESHOTELEntities();
                        var query = from res in context.Conditionnements
                                    where res.Libelle == rcbConditionnement.SearchText && res.Etat == "ACTIF"
                                    select res;
                        if (query.Count() != 0)
                        {
                        }
                        else
                        {
                            Conditionnements cd = new Conditionnements();
                            cd.Etat    = "ACTIF";
                            cd.idHotel = 1;
                            cd.Libelle = rcbCategorie.SearchText;
                            viewVM.model.Conditionnements.Add(cd);
                            ent.Conditionnements = cd;
                        }

                        var quer = from res in context.Categories
                                   where res.Libelle == rcbCategorie.SearchText && res.Etat == "ACTIF"
                                   select res;
                        if (quer.Count() != 0)
                        {
                        }
                        else
                        {
                            Categories cat = new Categories();
                            cat.Etat    = "ACTIF";
                            cat.idHotel = 1;
                            cat.Libelle = rcbCategorie.SearchText;
                            viewVM.model.Categories.Add(cat);
                            ent.Categories = cat;
                        }


                        ent.Etat    = "ACTIF";
                        ent.idHotel = 1;
                        viewVM.model.Produits.Add(ent);
                        viewVM.model.SaveChanges();
                        Msg = "OK";
                        this.Close();
                    }
                    catch (Exception ex)
                    {
                        Msg      = "Error";
                        ErrorMsg = ex.Message;
                    }
                }
                else
                {
                    try
                    {
                        viewVM.model.SaveChanges();
                        Msg = "OK";
                        this.Close();
                    }
                    catch (Exception ex)
                    {
                        Msg      = "Error";
                        ErrorMsg = ex.Message;
                    }
                }
            }
            catch (Exception)
            {
            }
        }