public static bool IsFiltersEmpty(ServiceAgence.CriteresRechercheBiensImmobiliers filters) { return(filters.AdresseContient == "" && filters.CodePostal == "" && filters.DateMiseEnTransaction1 == null && filters.DateMiseEnTransaction2 == null && filters.DateTransaction1 == null && filters.DateTransaction2 == null && filters.DescriptionContient == "" && filters.EnergieChauffage == null && filters.MontantCharges1 == -1 && filters.MontantCharges2 == -1 && filters.NbEtages1 == -1 && filters.NbEtages2 == -1 && filters.NbPieces1 == -1 && filters.NbPieces2 == -1 && filters.NumEtage1 == -1 && filters.NumEtage2 == -1 && filters.Prix1 == -1 && filters.Prix2 == -1 && filters.Surface1 == -1 && filters.Surface2 == -1 && filters.TitreContient == "" && filters.TransactionEffectuee == null && filters.TypeBien == null && filters.TypeChauffage == null && filters.TypeTransaction == null && filters.Ville == ""); }
public static ServiceAgence.CriteresRechercheBiensImmobiliers initNullCriteres() { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TransactionEffectuee = null; criteres.TypeBien = null; criteres.TypeChauffage = null; criteres.TypeTransaction = null; return criteres; }
public static ServiceAgence.CriteresRechercheBiensImmobiliers InitializeFilters() { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.AdresseContient = ""; criteres.CodePostal = ""; criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.DescriptionContient = ""; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TitreContient = ""; criteres.TransactionEffectuee = null; criteres.TypeBien = null; criteres.TypeChauffage = null; criteres.TypeTransaction = null; criteres.Ville = ""; return(criteres); }
public static ServiceAgence.CriteresRechercheBiensImmobiliers CloneFilters(ServiceAgence.CriteresRechercheBiensImmobiliers filters) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = InitializeFilters(); criteres.AdresseContient = filters.AdresseContient; criteres.CodePostal = filters.CodePostal; criteres.DateMiseEnTransaction1 = filters.DateMiseEnTransaction1; criteres.DateMiseEnTransaction2 = filters.DateMiseEnTransaction2; criteres.DateTransaction1 = filters.DateTransaction1; criteres.DateTransaction2 = filters.DateTransaction2; criteres.DescriptionContient = filters.DescriptionContient; criteres.EnergieChauffage = filters.EnergieChauffage; criteres.MontantCharges1 = filters.MontantCharges1; criteres.MontantCharges2 = filters.MontantCharges2; criteres.NbEtages1 = filters.NbEtages1; criteres.NbEtages2 = filters.NbEtages2; criteres.NbPieces1 = filters.NbPieces1; criteres.NbPieces2 = filters.NbPieces2; criteres.NumEtage1 = filters.NumEtage1; criteres.NumEtage2 = filters.NumEtage2; criteres.Prix1 = filters.Prix1; criteres.Prix2 = filters.Prix2; criteres.Surface1 = filters.Surface1; criteres.Surface2 = filters.Surface2; criteres.TitreContient = filters.TitreContient; criteres.TransactionEffectuee = filters.TransactionEffectuee; criteres.TypeBien = filters.TypeBien; criteres.TypeChauffage = filters.TypeChauffage; criteres.TypeTransaction = filters.TypeTransaction; criteres.Ville = filters.Ville; criteres.Tris = filters.Tris; return(criteres); }
public static ServiceAgence.CriteresRechercheBiensImmobiliers initNullCriteres() { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TransactionEffectuee = null; criteres.TypeBien = null; criteres.TypeChauffage = null; criteres.TypeTransaction = null; return(criteres); }
private void Initcriteres(ServiceAgence.CriteresRechercheBiensImmobiliers c) { c.TitreContient = ""; c.AdresseContient = ""; c.CodePostal = ""; c.DateMiseEnTransaction1 = null; c.DateMiseEnTransaction2 = null; c.DateTransaction1 = null; c.DateTransaction2 = null; c.DescriptionContient = ""; c.EnergieChauffage = null; c.MontantCharges1 = -1; c.MontantCharges2 = -1; c.NbEtages1 = -1; c.NbEtages2 = -1; c.NbPieces1 = -1; c.NbPieces2 = -1; c.NumEtage1 = -1; c.NumEtage2 = -1; c.Prix1 = -1; c.Prix2 = -1; c.Surface1 = -1; c.Surface2 = -1; c.TransactionEffectuee = null; c.Tris = null; c.TypeBien = null; c.TypeChauffage = null; c.TypeTransaction = null; c.Ville = ""; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { button_valider_Click(); } else { List <ServiceAgence.BienImmobilierBase> liste = null; using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TransactionEffectuee = null; criteres.TypeBien = null; criteres.TypeChauffage = null; criteres.TypeTransaction = null; ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); if (resultat.SuccesExecution) { liste = resultat.Liste.List; } else { liste = new List <ServiceAgence.BienImmobilierBase>(); this.mLabel.Text = resultat.ErreursBloquantes.ToString(); } } /*this.gvResultats.DataSource = liste; * this.gvResultats.DataBind();*/ Session["TaskTable"] = liste; //this.gvResultats.DataSource = liste; //this.gvResultats.DataBind(); BindData(); } }
public MainWindow() { InitializeComponent(); this._service = new ServiceAgence.AgenceClient("WSHttpBinding_IAgence"); this._filtres = null; this._bienBaseSelectionne = null; this._bienSelectionne = null; this._listeBiens = null; this.DataContext = this; }
private async void submit_form(object sender, RoutedEventArgs e) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = MainWindow.initNullCriteres(); if (this.types_transaction.SelectedValue != null) { criteres.TypeTransaction = (ServiceAgence.BienImmobilierBase.eTypeTransaction) this.types_transaction.SelectedValue; } if (this.types_chauffages.SelectedValue != null) { criteres.TypeChauffage = (ServiceAgence.BienImmobilierBase.eTypeChauffage) this.types_chauffages.SelectedValue; } if (this.energies_chauffage.SelectedValue != null) { criteres.EnergieChauffage = (ServiceAgence.BienImmobilierBase.eEnergieChauffage) this.energies_chauffage.SelectedValue; } if (this.types_biens.SelectedValue != null) { criteres.TypeBien = (ServiceAgence.BienImmobilierBase.eTypeBien) this.types_biens.SelectedValue; } if (this.prix_demande_min.Text != "") { criteres.Prix1 = double.Parse(prix_demande_min.Text, System.Globalization.CultureInfo.InvariantCulture); } if (this.prix_demande_max.Text != "") { criteres.Prix2 = Convert.ToDouble(this.prix_demande_max.Text); } if (this.surface_demande_min.Text != "") { criteres.Surface1 = Convert.ToDouble(this.surface_demande_min.Text); } if (this.surface_demande_max.Text != "") { criteres.Surface2 = Convert.ToDouble(this.surface_demande_max.Text); } String town = this.textbox_town.Text; criteres.Ville = town; await this.parent_windows.new_research(criteres); this.Close(); }
public FiltersWindow(ServiceAgence.CriteresRechercheBiensImmobiliers filtres) { InitializeComponent(); this.DataContext = this; if (filtres == null) { this.Filtres = InitializeFilters(); } else { this.Filtres = CloneFilters(filtres); } }
public async Task new_research(ServiceAgence.CriteresRechercheBiensImmobiliers criteres) { using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); if (resultat.SuccesExecution) { liste = resultat.Liste.List; } else { liste = new ObservableCollection <ServiceAgence.BienImmobilierBase>(); } } this._lastCritere = criteres; }
public MainWindow() { InitializeComponent(); this.DataContext = this; this.ListeBiens = new ObservableCollection <ServiceAgence.BienImmobilierBase>(); using (ServiceAgence.AgenceClient _service = new ServiceAgence.AgenceClient()) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TransactionEffectuee = null; ServiceAgence.ResultatListeBiensImmobiliers resultat; resultat = _service.LireListeBiensImmobiliers(criteres, null, null); ListeBiens = resultat.Liste.List; if (resultat.SuccesExecution) { ListeBiens = resultat.Liste.List; } else { ListeBiens = new ObservableCollection <ServiceAgence.BienImmobilierBase>(); //this.lblErreurs.Text = resultat.ErreursBloquantes.ToString(); } } }
private async void submit_form(object sender, RoutedEventArgs e) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = MainWindow.initNullCriteres(); if (this.types_transaction.SelectedValue != null) { ServiceAgence.BienImmobilierBase.eTypeTransaction type_transaction_value = (ServiceAgence.BienImmobilierBase.eTypeTransaction) this.types_transaction.SelectedValue; criteres.TypeTransaction = type_transaction_value; } String town = this.textbox_town.Text; criteres.Ville = town; await this.parent_windows.new_research(criteres); this.Close(); }
protected void Page_Load(object sender, EventArgs e) { using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { client.Open(); ServiceAgence.CriteresRechercheBiensImmobiliers c = new ServiceAgence.CriteresRechercheBiensImmobiliers(); Initcriteres(c); ServiceAgence.ResultatListeBiensImmobiliers res = client.LireListeBiensImmobiliers(c, 1, 4); this.rpResultats.DataSource = res.Liste.List; this.rpResultats.DataBind(); client.Close(); } }
protected void Page_Load(object sender, EventArgs e) { List<ServiceAgence.BienImmobilierBase> liste = null; using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers { DateMiseEnTransaction1 = null, DateMiseEnTransaction2 = null, DescriptionContient = null, DateTransaction1 = null, DateTransaction2 = null, EnergieChauffage = null, MontantCharges1 = -1, MontantCharges2 = -1, NbEtages1 = -1, NbEtages2 = -1, NbPieces1 = -1, NbPieces2 = -1, NumEtage1 = -1, NumEtage2 = -1, Prix1 = -1, Prix2 = -1, Surface1 = -1, Surface2 = -1, TransactionEffectuee = null, TypeBien = null, TypeChauffage = null, TypeTransaction = null }; ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); liste = resultat.SuccesExecution ? resultat.Liste.List : new List<ServiceAgence.BienImmobilierBase>(); } this.rpResultats.DataSource = liste; this.rpResultats.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { this.ListeBiens = new ObservableCollection <ServiceAgence.BienImmobilierBase>(); using (ServiceAgence.AgenceClient _service = new ServiceAgence.AgenceClient()) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TransactionEffectuee = null; ServiceAgence.ResultatListeBiensImmobiliers resultat; resultat = _service.LireListeBiensImmobiliers(criteres, null, null); // ListeBiens = resultat.Liste; if (resultat.SuccesExecution) { //ListeBiens = resultat.Liste.List; } else { ListeBiens = new ObservableCollection <ServiceAgence.BienImmobilierBase>(); //this.lblErreurs.Text = resultat.ErreursBloquantes.ToString(); } } }
public MainWindow() { InitializeComponent(); this.ListeBienImmo = new ObservableCollection <ServiceAgence.BienImmobilierBase>(); this.filtre = new ServiceAgence.CriteresRechercheBiensImmobiliers(); InitFiltre(); new Action(async() => { await InitBiensAsync(); }).Invoke(); this.DataContext = this; }
protected async void ChargerBiensImmobiliers(int page = 1) { this.ChargementListe = true; ServiceAgence.CriteresRechercheBiensImmobiliers criteres = null; ServiceAgence.ResultatListeBiensImmobiliers resultat = null; if (this._filtres == null) { criteres = FiltersWindow.InitializeFilters(); } else { criteres = this._filtres; } criteres.TypeTransaction = this._typeTransaction; // Appel au service WCF try { resultat = await this._service.LireListeBiensImmobiliersAsync(criteres, page, NB_BIENS_IMMOBILIERS_PAR_PAGE); if (resultat.SuccesExecution) { this.ListeBiens = resultat.Liste; this.BienBaseSelectionne = null; } else { AfficherErreur(resultat); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Erreur", MessageBoxButton.OK, MessageBoxImage.Error); } this.ChargementListe = false; }
private void BindData() { using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { client.Open(); ServiceAgence.CriteresRechercheBiensImmobiliers c = new ServiceAgence.CriteresRechercheBiensImmobiliers(); Initcriteres(c); if (IsPostBack) { c.TitreContient = Titre.Text; if (DropDownListTypeBien.SelectedValue != "-1") { Catalogue obj = new Catalogue(); c.TypeBien = (ServiceAgence.BienImmobilierBase.eTypeBien)obj.AffectSelectedValue(DropDownListTypeBien); } c.AdresseContient = Adresse.Text; c.CodePostal = CP.Text; c.Ville = Ville.Text; } ServiceAgence.ResultatListeBiensImmobiliers res = client.LireListeBiensImmobiliers(c, 0, 8); List <ServiceAgence.BienImmobilierBase> liste = res.Liste.List; this.gvDisplay.DataSource = liste; this.gvDisplay.DataBind(); client.Close(); } }
protected void Page_Load(object sender, EventArgs e) { List<ServiceAgence.BienImmobilierBase> liste = null; String nbpieces1 = null; String nbpieces2 = null; String prix1 = null; String prix2 = null; String surface1 = null; String surface2 = null; using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { if(Request.QueryString["prix_demande"] != null) { string[] words = Request.QueryString["prix_demande"].TrimStart(',').Split(','); if(words.Length == 2) { if (Convert.ToInt32(words[0]) > Convert.ToInt32(words[1])) { prix1 = words[1]; prix2 = words[0]; } else { prix1 = words[0]; prix2 = words[1]; } } } if (Request.QueryString["surface_demande"] != null) { string[] words = Request.QueryString["surface_demande"].TrimStart(',').Split(','); if (words.Length == 2) { if(Convert.ToInt32(words[0]) > Convert.ToInt32(words[1])) { surface1 = words[1]; surface2 = words[0]; } else { surface1 = words[0]; surface2 = words[1]; } } } if (Request.QueryString["nombre_piece_demande"] != null) { string[] words = Request.QueryString["nombre_piece_demande"].TrimStart(',').Split(','); if (words.Length == 2) { nbpieces1 = words[0]; nbpieces2 = words[1]; } } ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = (null != Request.QueryString["date_mise_transaction_1"] && "" != Request.QueryString["date_mise_transaction_1"] ? DateTime.Parse(Request.QueryString["date_mise_transaction_1"]) : (DateTime?)null); criteres.DateMiseEnTransaction2 = (null != Request.QueryString["date_mise_transaction_2"] && "" != Request.QueryString["date_mise_transaction_2"] ? DateTime.Parse(Request.QueryString["date_mise_transaction_2"]) : (DateTime?)null); criteres.DateTransaction1 = (null != Request.QueryString["date_transaction_1"] && "" != Request.QueryString["date_transaction_1"] ? DateTime.Parse(Request.QueryString["date_transaction_1"]) : (DateTime?)null); criteres.DateTransaction2 = (null != Request.QueryString["date_transaction_2"] && "" != Request.QueryString["date_transaction_2"] ? DateTime.Parse(Request.QueryString["date_transaction_2"]) : (DateTime?)null); criteres.MontantCharges1 = (null != Request.QueryString["montantcharges1"] && "" != Request.QueryString["montantcharges1"] ? int.Parse(Request.QueryString["montantcharges1"]) : -1); criteres.MontantCharges2 = (null != Request.QueryString["montantcharges2"] && "" != Request.QueryString["montantcharges2"] ? int.Parse(Request.QueryString["montantcharges2"]) : -1); criteres.NbEtages1 = (null != Request.QueryString["nbetages1"] && "" != Request.QueryString["nbetages1"] ? int.Parse(Request.QueryString["nbetages1"]) : -1); criteres.NbEtages2 = (null != Request.QueryString["nbetages2"] && "" != Request.QueryString["nbetages2"] ? int.Parse(Request.QueryString["nbetages2"]) : -1); criteres.NumEtage1 = (null != Request.QueryString["numetage1"] && "" != Request.QueryString["numetage1"] ? int.Parse(Request.QueryString["numetage1"]) : -1); criteres.NumEtage2 = (null != Request.QueryString["numetage2"] && "" != Request.QueryString["numetage2"] ? int.Parse(Request.QueryString["numetage2"]) : -1); criteres.NbPieces1 = (null != nbpieces1 && "" != nbpieces1 ? int.Parse(nbpieces1) : -1); criteres.NbPieces2 = (null != nbpieces2 && "" != nbpieces2 ? int.Parse(nbpieces2) : -1); criteres.Prix1 = (null != prix1 && "" != prix1 ? Double.Parse(prix1) : -1); criteres.Prix2 = (null != prix2 && "" != prix2 ? Double.Parse(prix2) : -1); criteres.Surface1 = (null != surface1 && "" != surface1 ? Double.Parse(surface1) : -1); criteres.Surface2 = (null != surface2 && "" != surface2 ? Double.Parse(surface2) : -1); criteres.TransactionEffectuee = (null != Request.QueryString["transaction_effectue"] && "" != Request.QueryString["transaction_effectue"] ? Boolean.Parse(Request.QueryString["transaction_effectue"]) : (bool?) null); criteres.Ville = "" != Request.QueryString["town"] ? Request.QueryString["town"] : null; criteres.TypeBien = null; String key = localiseKey("type_bien"); if(key != null) { if (key != "-1") criteres.TypeBien = (ServiceAgence.BienImmobilierBase.eTypeBien)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eTypeBien), key); else criteres.TypeBien = null; } criteres.TypeBien = null; key = localiseKey("energie_chauffage"); if (key != null) { if (key != "-1") criteres.EnergieChauffage = (ServiceAgence.BienImmobilierBase.eEnergieChauffage)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eEnergieChauffage), key); else criteres.EnergieChauffage = null; } criteres.TypeChauffage = null; key = localiseKey("type_chauffage"); if (key != null) { if (key != "-1") criteres.TypeChauffage = (ServiceAgence.BienImmobilierBase.eTypeChauffage)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eTypeChauffage), key); else criteres.TypeChauffage = null; } criteres.TypeTransaction = null; key = localiseKey("type_transaction"); System.Diagnostics.Debug.WriteLine(key); if (key != null) { if (key != "-1") criteres.TypeTransaction = (ServiceAgence.BienImmobilierBase.eTypeTransaction)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eTypeTransaction), key); else criteres.TypeTransaction = null; } ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); if (resultat.SuccesExecution) { liste = resultat.Liste.List; } else { liste = new List<ServiceAgence.BienImmobilierBase>(); this.mLabel.Text = resultat.ErreursBloquantes.ToString(); } } /*this.gvResultats.DataSource = liste; this.gvResultats.DataBind();*/ this.rpResultats.DataSource = liste; this.rpResultats.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { List <ServiceAgence.BienImmobilierBase> liste = null; String nbpieces1 = null; String nbpieces2 = null; String prix1 = null; String prix2 = null; String surface1 = null; String surface2 = null; using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { if (Request.QueryString["prix_demande"] != null) { string[] words = Request.QueryString["prix_demande"].TrimStart(',').Split(','); if (words.Length == 2) { if (Convert.ToInt32(words[0]) > Convert.ToInt32(words[1])) { prix1 = words[1]; prix2 = words[0]; } else { prix1 = words[0]; prix2 = words[1]; } } } if (Request.QueryString["surface_demande"] != null) { string[] words = Request.QueryString["surface_demande"].TrimStart(',').Split(','); if (words.Length == 2) { if (Convert.ToInt32(words[0]) > Convert.ToInt32(words[1])) { surface1 = words[1]; surface2 = words[0]; } else { surface1 = words[0]; surface2 = words[1]; } } } if (Request.QueryString["nombre_piece_demande"] != null) { string[] words = Request.QueryString["nombre_piece_demande"].TrimStart(',').Split(','); if (words.Length == 2) { nbpieces1 = words[0]; nbpieces2 = words[1]; } } ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = (null != Request.QueryString["date_mise_transaction_1"] && "" != Request.QueryString["date_mise_transaction_1"] ? DateTime.Parse(Request.QueryString["date_mise_transaction_1"]) : (DateTime?)null); criteres.DateMiseEnTransaction2 = (null != Request.QueryString["date_mise_transaction_2"] && "" != Request.QueryString["date_mise_transaction_2"] ? DateTime.Parse(Request.QueryString["date_mise_transaction_2"]) : (DateTime?)null); criteres.DateTransaction1 = (null != Request.QueryString["date_transaction_1"] && "" != Request.QueryString["date_transaction_1"] ? DateTime.Parse(Request.QueryString["date_transaction_1"]) : (DateTime?)null); criteres.DateTransaction2 = (null != Request.QueryString["date_transaction_2"] && "" != Request.QueryString["date_transaction_2"] ? DateTime.Parse(Request.QueryString["date_transaction_2"]) : (DateTime?)null); criteres.MontantCharges1 = (null != Request.QueryString["montantcharges1"] && "" != Request.QueryString["montantcharges1"] ? int.Parse(Request.QueryString["montantcharges1"]) : -1); criteres.MontantCharges2 = (null != Request.QueryString["montantcharges2"] && "" != Request.QueryString["montantcharges2"] ? int.Parse(Request.QueryString["montantcharges2"]) : -1); criteres.NbEtages1 = (null != Request.QueryString["nbetages1"] && "" != Request.QueryString["nbetages1"] ? int.Parse(Request.QueryString["nbetages1"]) : -1); criteres.NbEtages2 = (null != Request.QueryString["nbetages2"] && "" != Request.QueryString["nbetages2"] ? int.Parse(Request.QueryString["nbetages2"]) : -1); criteres.NumEtage1 = (null != Request.QueryString["numetage1"] && "" != Request.QueryString["numetage1"] ? int.Parse(Request.QueryString["numetage1"]) : -1); criteres.NumEtage2 = (null != Request.QueryString["numetage2"] && "" != Request.QueryString["numetage2"] ? int.Parse(Request.QueryString["numetage2"]) : -1); criteres.NbPieces1 = (null != nbpieces1 && "" != nbpieces1 ? int.Parse(nbpieces1) : -1); criteres.NbPieces2 = (null != nbpieces2 && "" != nbpieces2 ? int.Parse(nbpieces2) : -1); criteres.Prix1 = (null != prix1 && "" != prix1 ? Double.Parse(prix1) : -1); criteres.Prix2 = (null != prix2 && "" != prix2 ? Double.Parse(prix2) : -1); criteres.Surface1 = (null != surface1 && "" != surface1 ? Double.Parse(surface1) : -1); criteres.Surface2 = (null != surface2 && "" != surface2 ? Double.Parse(surface2) : -1); criteres.TransactionEffectuee = (null != Request.QueryString["transaction_effectue"] && "" != Request.QueryString["transaction_effectue"] ? Boolean.Parse(Request.QueryString["transaction_effectue"]) : (bool?)null); criteres.Ville = "" != Request.QueryString["town"] ? Request.QueryString["town"] : null; criteres.TypeBien = null; String key = localiseKey("type_bien"); if (key != null) { if (key != "-1") { criteres.TypeBien = (ServiceAgence.BienImmobilierBase.eTypeBien)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eTypeBien), key); } else { criteres.TypeBien = null; } } criteres.TypeBien = null; key = localiseKey("energie_chauffage"); if (key != null) { if (key != "-1") { criteres.EnergieChauffage = (ServiceAgence.BienImmobilierBase.eEnergieChauffage)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eEnergieChauffage), key); } else { criteres.EnergieChauffage = null; } } criteres.TypeChauffage = null; key = localiseKey("type_chauffage"); if (key != null) { if (key != "-1") { criteres.TypeChauffage = (ServiceAgence.BienImmobilierBase.eTypeChauffage)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eTypeChauffage), key); } else { criteres.TypeChauffage = null; } } criteres.TypeTransaction = null; key = localiseKey("type_transaction"); System.Diagnostics.Debug.WriteLine(key); if (key != null) { if (key != "-1") { criteres.TypeTransaction = (ServiceAgence.BienImmobilierBase.eTypeTransaction)Enum.Parse(typeof(ServiceAgence.BienImmobilierBase.eTypeTransaction), key); } else { criteres.TypeTransaction = null; } } ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); if (resultat.SuccesExecution) { liste = resultat.Liste.List; } else { liste = new List <ServiceAgence.BienImmobilierBase>(); this.mLabel.Text = resultat.ErreursBloquantes.ToString(); } } /*this.gvResultats.DataSource = liste; * this.gvResultats.DataBind();*/ this.rpResultats.DataSource = liste; this.rpResultats.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { button_valider_Click(); } else { List<ServiceAgence.BienImmobilierBase> liste = null; using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { ServiceAgence.CriteresRechercheBiensImmobiliers criteres = new ServiceAgence.CriteresRechercheBiensImmobiliers(); criteres.DateMiseEnTransaction1 = null; criteres.DateMiseEnTransaction2 = null; criteres.DateTransaction1 = null; criteres.DateTransaction2 = null; criteres.EnergieChauffage = null; criteres.MontantCharges1 = -1; criteres.MontantCharges2 = -1; criteres.NbEtages1 = -1; criteres.NbEtages2 = -1; criteres.NbPieces1 = -1; criteres.NbPieces2 = -1; criteres.NumEtage1 = -1; criteres.NumEtage2 = -1; criteres.Prix1 = -1; criteres.Prix2 = -1; criteres.Surface1 = -1; criteres.Surface2 = -1; criteres.TransactionEffectuee = null; criteres.TypeBien = null; criteres.TypeChauffage = null; criteres.TypeTransaction = null; ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); if (resultat.SuccesExecution) { liste = resultat.Liste.List; } else { liste = new List<ServiceAgence.BienImmobilierBase>(); this.mLabel.Text = resultat.ErreursBloquantes.ToString(); } } /*this.gvResultats.DataSource = liste; this.gvResultats.DataBind();*/ Session["TaskTable"] = liste; //this.gvResultats.DataSource = liste; //this.gvResultats.DataBind(); BindData(); } }
private void Empty_Button_Click(object sender, RoutedEventArgs e) { this._filtres = null; this.DialogResult = true; this.Close(); }
public async Task new_research(ServiceAgence.CriteresRechercheBiensImmobiliers criteres) { using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { ServiceAgence.ResultatListeBiensImmobiliers resultat = client.LireListeBiensImmobiliers(criteres, null, null); if (resultat.SuccesExecution) { liste = resultat.Liste.List; } else { liste = new ObservableCollection<ServiceAgence.BienImmobilierBase>(); } } this._lastCritere = criteres; }
protected void Page_Load(object sender, EventArgs e) { using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { client.Open(); ServiceAgence.CriteresRechercheBiensImmobiliers a = new ServiceAgence.CriteresRechercheBiensImmobiliers(); Initcriteres(a); if (!this.IsPostBack) { Load_DropDownListItem <ServiceAgence.BienImmobilierBase.eTypeBien>(DropDownListTypeBien, true); Load_DropDownListItem <ServiceAgence.BienImmobilierBase.eTypeChauffage>(DropDownListTypeChauffage, true); Load_DropDownListItem <ServiceAgence.BienImmobilierBase.eEnergieChauffage>(DropDownListEnergieChauffage, true); Load_DropDownListItem <ServiceAgence.BienImmobilierBase.eTypeTransaction>(DropDownListTypeTransaction, true); DropDownListTypeBien.SelectedValue = "-1"; DropDownListEnergieChauffage.SelectedValue = "-1"; DropDownListTypeChauffage.SelectedValue = "-1"; DropDownListTypeTransaction.SelectedValue = "-1"; } if (this.IsPostBack) { if (Request.Form["searchtype"] != null) { // Recherche simple a.TitreContient = RechercheTitre_simple.Text; } else {// Recherche avancée a.TitreContient = RechercheTitre_adv.Text; a.DescriptionContient = RechercheDescription.Text; a.AdresseContient = RechercheAdresse.Text; a.CodePostal = RechercheCodePostal.Text; a.Ville = RechercheVille.Text; if (DropDownListTypeBien.SelectedValue != "-1") { a.TypeBien = (ServiceAgence.BienImmobilierBase.eTypeBien)AffectSelectedValue(DropDownListTypeBien); } if (DropDownListEnergieChauffage.SelectedValue != "-1") { a.EnergieChauffage = (ServiceAgence.BienImmobilierBase.eEnergieChauffage)AffectSelectedValue(DropDownListEnergieChauffage); } if (DropDownListTypeChauffage.SelectedValue != "-1") { a.TypeChauffage = (ServiceAgence.BienImmobilierBase.eTypeChauffage)AffectSelectedValue(DropDownListTypeChauffage); } if (DropDownListTypeTransaction.SelectedValue != "-1") { a.TypeTransaction = (ServiceAgence.BienImmobilierBase.eTypeTransaction)AffectSelectedValue(DropDownListTypeTransaction); } double Number = 0; if (Double.TryParse(RecherchePrixMin.Text, out Number)) { a.Prix1 = Number; } if (Double.TryParse(RecherchePrixMax.Text, out Number)) { a.Prix2 = Number; } if (Double.TryParse(RechercheSurfaceMin.Text, out Number)) { a.Surface1 = Number; } if (Double.TryParse(RechercheSurfaceMax.Text, out Number)) { a.Surface2 = Number; } if (Double.TryParse(RechercheEtageMin.Text, out Number)) { a.NbEtages1 = (int)Number; } if (Double.TryParse(RechercheEtageMax.Text, out Number)) { a.NbEtages2 = (int)Number; } if (Double.TryParse(RecherchePieceMin.Text, out Number)) { a.NbPieces1 = (int)Number; } if (Double.TryParse(RecherchePieceMax.Text, out Number)) { a.NbPieces2 = (int)Number; } } } ServiceAgence.ResultatListeBiensImmobiliers res = client.LireListeBiensImmobiliers(a, 0, 2); this.rpResultats.DataSource = res.Liste.List; this.rpResultats.DataBind(); client.Close(); } }
private void BindData() { using (ServiceAgence.AgenceClient client = new ServiceAgence.AgenceClient()) { client.Open(); ServiceAgence.CriteresRechercheBiensImmobiliers c = new ServiceAgence.CriteresRechercheBiensImmobiliers(); Initcriteres(c); if (IsPostBack) { c.TitreContient = Titre.Text; if (DropDownListTypeBien.SelectedValue != "-1") { Catalogue obj = new Catalogue(); c.TypeBien = (ServiceAgence.BienImmobilierBase.eTypeBien)obj.AffectSelectedValue(DropDownListTypeBien); } c.AdresseContient = Adresse.Text; c.CodePostal = CP.Text; c.Ville = Ville.Text; } ServiceAgence.ResultatListeBiensImmobiliers res = client.LireListeBiensImmobiliers(c, 0, 8); List<ServiceAgence.BienImmobilierBase> liste = res.Liste.List; this.gvDisplay.DataSource = liste; this.gvDisplay.DataBind(); client.Close(); } }