crlUSAbonnementNV IntfDalUSAbonnementNVDevis.getUSAbonnementNV(crlUSAbonnementNVDevis abonnementNVDevis) { #region declaration crlUSAbonnementNV abonnementNV = null; crlUSPlageNombreBillet plageNombreBillet = null; IntfDalUSPlageNombreBillet serviceUSPlageNombreBillet = new ImplDalUSPlageNombreBillet(); #endregion #region implementation if (abonnementNVDevis != null) { abonnementNV = new crlUSAbonnementNV(); abonnementNV.NumAbonnement = abonnementNVDevis.NumAbonnement; abonnementNV.NumZoneD = abonnementNVDevis.NumZoneD; abonnementNV.NumZoneF = abonnementNVDevis.NumZoneF; abonnementNV.NumCarte = abonnementNVDevis.NumCarte; plageNombreBillet = serviceUSPlageNombreBillet.getPlageNombreBillet(abonnementNVDevis.infoPasse.NombrePasse); if (plageNombreBillet != null) { abonnementNV.DateValideAu = DateTime.Now.Add(plageNombreBillet.DureeDeValidite); } } #endregion return(abonnementNV); }
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); }