DataTable IntfDalUSPlageNombreBillet.getDataTablePlageNombreBillet(string strRqst) { #region declaration DataTable dataTable = new DataTable(); IntfDalGeneral serviceGeneral = new ImplDalGeneral(); #endregion #region implementation #region initialisation du dataTable dataTable = new DataTable(); dataTable.Columns.Add("numPlageNombreBillet", typeof(string)); dataTable.Columns.Add("plage", typeof(string)); dataTable.Columns.Add("dureeDeValidite", typeof(string)); dataTable.Columns.Add("reductionBillet", typeof(string)); dataTable.Columns.Add("reductionPourcentage", typeof(string)); dataTable.Columns.Add("reductionMontant", typeof(string)); DataRow dr; #endregion this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); dr["numPlageNombreBillet"] = reader["numPlageNombreBillet"].ToString(); dr["plage"] = reader["nombreD"].ToString() + " à " + reader["nombreF"].ToString(); dr["dureeDeValidite"] = serviceGeneral.getTextTimeSpan(reader["dureeDeValidite"].ToString()); dr["reductionBillet"] = reader["reductionBillet"].ToString(); dr["reductionPourcentage"] = reader["reductionPourcentage"].ToString() + " %"; dr["reductionMontant"] = reader["reductionMontant"].ToString() + " Ar"; dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }
DataTable IntfDalUSInfoPasse.getDataTableInfoPasse(string strRqst) { #region declaration DataTable dataTable = new DataTable(); IntfDalGeneral serviceGeneral = new ImplDalGeneral(); IntfDalUSPlageNombreBillet serviceUSPlageNombreBillet = new ImplDalUSPlageNombreBillet(); IntfDalUSReductionBillet serviceUSReductionBillet = new ImplDalUSReductionBillet(); IntfDalUSPrixBase serviceUSPrixBase = new ImplDalUSPrixBase(); crlUSReductionBillet reduction = null; crlUSPlageNombreBillet plageNombreBillet = null; crlUSPrixBase prixBase = null; #endregion #region implementation #region initialisation du dataTable dataTable = new DataTable(); dataTable.Columns.Add("numInfoPasse", typeof(string)); dataTable.Columns.Add("nombrePasse", typeof(string)); dataTable.Columns.Add("niveau", typeof(string)); dataTable.Columns.Add("prixUnitaire", typeof(string)); dataTable.Columns.Add("dureeValidite", typeof(string)); DataRow dr; #endregion this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); dr["numInfoPasse"] = reader["numInfoPasse"].ToString(); dr["nombrePasse"] = reader["nombrePasse"].ToString(); dr["niveau"] = reader["niveau"].ToString(); reduction = serviceUSReductionBillet.selectUSReductionBillet(this.reader["numReductionBillet"].ToString()); try { prixBase = serviceUSPrixBase.selectUSPrixBase(int.Parse(reader["niveau"].ToString())); } catch (Exception) { } try { plageNombreBillet = serviceUSPlageNombreBillet.getPlageNombreBillet(int.Parse(reader["nombrePasse"].ToString())); } catch (Exception) { } if (prixBase != null) { if (reduction != null) { if (reduction.ReductionMontant > 0) { dr["prixUnitaire"] = serviceGeneral.separateurDesMilles((prixBase.MontantPrixBase - reduction.ReductionMontant).ToString("0")) + " Ar"; } else { dr["prixUnitaire"] = serviceGeneral.separateurDesMilles((prixBase.MontantPrixBase - (prixBase.MontantPrixBase * reduction.ReductionPourcentage / 100)).ToString("0")) + " Ar"; } } else { dr["prixUnitaire"] = serviceGeneral.separateurDesMilles(prixBase.MontantPrixBase.ToString("0")) + " Ar"; } } else { dr["prixUnitaire"] = ""; } if (plageNombreBillet != null) { dr["dureeValidite"] = serviceGeneral.getTextTimeSpan(serviceGeneral.getStringTimeSpan(plageNombreBillet.DureeDeValidite)); } else { dr["dureeValidite"] = ""; } reduction = null; prixBase = null; plageNombreBillet = null; dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }
DataTable IntfDalTrajet.getDataTableTrajetNotItineraire(string strRqst) { #region declaration DataTable dataTable = new DataTable(); IntfDalVille serviceVille = new ImplDalVille(); IntfDalGeneral serviceGeneral = new ImplDalGeneral(); crlVille villeD = null; crlVille villeF = null; string strTrajet = ""; #endregion #region initialise table dataTable.Columns.Add("numTrajet", typeof(string)); dataTable.Columns.Add("distanceTrajet", typeof(string)); dataTable.Columns.Add("dureeTrajet", typeof(string)); dataTable.Columns.Add("trajet", typeof(string)); DataRow dr = null; #endregion #region implementation this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); dr["numTrajet"] = this.reader["numTrajet"].ToString(); dr["distanceTrajet"] = this.reader["distanceTrajet"].ToString() + "Km"; dr["dureeTrajet"] = serviceGeneral.getTextTimeSpan(this.reader["dureeTrajet"].ToString()); villeD = serviceVille.selectVille(this.reader["numVilleD"].ToString()); villeF = serviceVille.selectVille(this.reader["numVilleF"].ToString()); if (villeD != null) { strTrajet += villeD.NomVille; } else { strTrajet += this.reader["numVilleD"].ToString(); } if (villeF != null) { strTrajet += "-" + villeF.NomVille; } else { strTrajet += "-" + this.reader["numVilleF"].ToString(); } dr["trajet"] = strTrajet; strTrajet = ""; dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }
DataTable IntfDalUSTrajet.getDataTableTrajet(string strRqst) { #region declaration DataTable dataTable = new DataTable(); crlUSArret arretD = null; crlUSArret arretF = null; crlUSLieu lieuD = null; crlUSLieu lieuF = null; crlQuartier quartierD = null; crlQuartier quartierF = null; IntfDalUSArret serviceUSArret = new ImplDalUSArret(); IntfDalUSLieu serviceUSLieu = new ImplDalUSLieu(); IntfDalGeneral serviceGeneral = new ImplDalGeneral(); IntfDalQuartier serviceQuartier = new ImplDalQuartier(); #endregion #region implementation #region initialisation du dataTable dataTable = new DataTable(); dataTable.Columns.Add("numTrajet", typeof(string)); dataTable.Columns.Add("distanceTrajet", typeof(string)); dataTable.Columns.Add("dureeTrajet", typeof(string)); dataTable.Columns.Add("trajet", typeof(string)); DataRow dr; #endregion this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(strRqst); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { dr = dataTable.NewRow(); dr["numTrajet"] = reader["numTrajet"].ToString(); dr["distanceTrajet"] = reader["distanceTrajet"].ToString() + "Km"; dr["dureeTrajet"] = serviceGeneral.getTextTimeSpan(reader["dureeTrajet"].ToString()); arretD = serviceUSArret.selectUSArret(this.reader["numArretD"].ToString()); arretF = serviceUSArret.selectUSArret(this.reader["numArretF"].ToString()); if (arretD != null && arretF != null) { lieuD = serviceUSLieu.selectUSLieu(arretD.NumLieu); lieuF = serviceUSLieu.selectUSLieu(arretF.NumLieu); if (lieuD != null && lieuF != null) { quartierD = serviceQuartier.selectQuartier(lieuD.NumQuartier); quartierF = serviceQuartier.selectQuartier(lieuF.NumQuartier); if (quartierF != null && quartierF != null) { dr["trajet"] = quartierD.Quartier + "/" + arretD.NomArret + "-" + quartierF.Quartier + "/" + arretF.NomArret; } else { dr["trajet"] = arretD.NomArret + "-" + arretF.NomArret; } } else { dr["trajet"] = arretD.NomArret + "-" + arretF.NomArret; } } else { dr["trajet"] = this.reader["numArretD"].ToString() + "-" + this.reader["numArretF"].ToString(); } dataTable.Rows.Add(dr); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); #endregion return(dataTable); }