bool IntfDalVoyage.deleteAllVoyage(string idVoyage) { #region declaration crlVoyage voyage = null; bool isDelete = false; IntfDalVoyage serviceVoyage = new ImplDalVoyage(); IntfDalRecu serviceRecu = new ImplDalRecu(); IntfDalBagage serviceBagage = new ImplDalBagage(); #endregion #region implementation if (idVoyage != "") { voyage = serviceVoyage.selectVoyage(idVoyage); if (voyage != null) { serviceBagage.deleteAssociationBagageVoyage(voyage.IdVoyage); if (voyage.bagage != null) { serviceRecu.deleteRecu(voyage.bagage.NumRecu); serviceBagage.deleteBagage(voyage.bagage.IdBagage); } isDelete = serviceVoyage.deleteVoyage(idVoyage); } } #endregion return(isDelete); }
string IntfDalRecu.insertRecu(crlRecu Recu) { #region declaration IntfDalRecu serviceRecu = new ImplDalRecu(); int nombreInsertion = 0; string numRecu = ""; #endregion #region implementation if (Recu != null) { Recu.NumRecu = serviceRecu.getNumRecu(); this.strCommande = "INSERT INTO `recu` (`numRecu`,`libele`,`montant`,`date`,`modePaiement`,`matriculeAgent`)"; this.strCommande += " VALUES ('" + Recu.NumRecu + "', '" + Recu.Libele + "', '" + Recu.Montant + "',"; this.strCommande += " '" + Recu.Date.ToString("yyyy-MM-dd") + "','" + Recu.ModePaiement + "','" + Recu.MatriculeAgent + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { numRecu = Recu.NumRecu; } this.serviceConnectBase.closeConnection(); } #endregion return(numRecu); }
void IntfDalRecu.insertToGridRecuEncaisser(GridView gridView, string param, string paramLike, string valueLike, string matriculeAgent, DateTime dateDebut, DateTime dateFin) { #region declaration IntfDalRecu serviceRecu = new ImplDalRecu(); #endregion #region implementation this.strCommande = "SELECT recu.numRecu, recu.libele, recu.montant, (recu.`date`) As dateRecu,"; this.strCommande += " recu.modePaiement, recu.matriculeAgent FROM recu"; this.strCommande += " WHERE recu.matriculeAgent = '" + matriculeAgent + "' AND"; this.strCommande += " recu.modePaiement = 'Espèce' AND"; this.strCommande += " recu.`date` <= '" + dateFin.ToString("yyyy-MM-dd") + "' AND"; this.strCommande += " recu.`date` >= '" + dateDebut.ToString("yyyy-MM-dd") + "' AND"; this.strCommande += " (" + paramLike + " LIKE '%" + valueLike + "%')"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceRecu.getDataTableRecuEncaisser(this.strCommande); gridView.DataBind(); #endregion }
void IntfDalRecu.insertToGridRecu(GridView gridView, string param, string paramLike, string valueLike, string numAgence) { #region declaration IntfDalRecu serviceRecu = new ImplDalRecu(); #endregion #region implementation this.strCommande = "SELECT (recu.numRecu) As NRecu, recu.libele, recu.montant, (recu.`date`) As dateRecu,"; this.strCommande += " recu.modePaiement, recu.matriculeAgent FROM recu"; this.strCommande += " Left Join bagage ON bagage.numRecu = recu.numRecu"; this.strCommande += " Left Join commission ON commission.numRecu = recu.numRecu"; this.strCommande += " Inner Join agent ON agent.matriculeAgent = recu.matriculeAgent"; this.strCommande += " WHERE bagage.numRecu IS NULL AND"; this.strCommande += " commission.numRecu IS NULL AND"; this.strCommande += " agent.numAgence = '" + numAgence + "' AND"; this.strCommande += " (" + paramLike + " LIKE '%" + valueLike + "%')"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceRecu.getDataTableRecu(this.strCommande); gridView.DataBind(); #endregion }
List <crlCommission> IntfDalFicheBord.getCommission(string numerosFB) { #region declaration List <crlCommission> Commissions = new List <crlCommission>(); crlCommission tempCommission = null; IntfDalReceptionnaire servicePersonne = new ImplDalReceptionnaire(); IntfDalRecu serviceRecu = new ImplDalRecu(); IntfDalClient serviceClient = new ImplDalClient(); IntfDalDesignationCommission serviceDesignationCommission = new ImplDalDesignationCommission(); IntfDalAgent serviceAgent = new ImplDalAgent(); #endregion #region implementation if (numerosFB != "") { this.strCommande = "SELECT * FROM commission"; this.strCommande += " Inner Join associationfichebordcommission ON associationfichebordcommission.idCommission = commission.idCommission"; this.strCommande += " WHERE (associationfichebordcommission.numerosFB ='" + numerosFB + "')"; this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { while (this.reader.Read()) { tempCommission = new crlCommission(); tempCommission.IdCommission = reader["idCommission"].ToString(); tempCommission.Destination = reader["destination"].ToString(); tempCommission.Poids = reader["poids"].ToString(); try { tempCommission.Nombre = int.Parse(reader["nombre"].ToString()); } catch (Exception) { } try { tempCommission.IsRecu = int.Parse(reader["isRecu"].ToString()); } catch (Exception) { } tempCommission.PieceJustificatif = reader["pieceJustificatif"].ToString(); tempCommission.FraisEnvoi = reader["fraisEnvoi"].ToString(); tempCommission.NumExpediteur = reader["numExpediteur"].ToString(); tempCommission.NumRecepteur = reader["numRecepteur"].ToString(); tempCommission.NumDesignation = reader["numDesignation"].ToString(); tempCommission.TypeCommission = reader["typeCommission"].ToString(); tempCommission.NumTrajet = reader["numTrajet"].ToString(); try { tempCommission.DateCommission = Convert.ToDateTime(reader["dateCommission"].ToString()); } catch (Exception) { } try { tempCommission.DateLivraison = Convert.ToDateTime(reader["dateLivraison"].ToString()); } catch (Exception) { } tempCommission.MatriculeAgent = reader["matriculeAgent"].ToString(); tempCommission.MatriculeAgentDelivreur = reader["matriculeAgentDelivreur"].ToString(); tempCommission.ModePaiement = reader["modePaiement"].ToString(); Commissions.Add(tempCommission); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); for (int i = 0; i < Commissions.Count; i++) { if (Commissions[i] != null) { Commissions[i].expediteur = serviceClient.selectClient(Commissions[i].NumExpediteur); Commissions[i].recepteur = servicePersonne.selectPersonne(Commissions[i].NumRecepteur); Commissions[i].designationCommission = serviceDesignationCommission.selectDesignationCommission(Commissions[i].NumDesignation); Commissions[i].typeCommssionObjet = new crlTypeCommssion(); Commissions[i].typeCommssionObjet.TypeCommission = Commissions[i].TypeCommission; Commissions[i].agent = serviceAgent.selectAgent(Commissions[i].MatriculeAgent); Commissions[i].agentDelivreur = serviceAgent.selectAgent(Commissions[i].MatriculeAgentDelivreur); } } } #endregion return(Commissions); }