Example #1
0
        public static DataTable getDataTable(CritereRechercheOperation criteres)
        {
            IDataReader reader = get(criteres);
            DataTable   dt     = new DataTable();

            if (reader != null)
            {
                dt.Load(reader);
                reader.Close();
            }
            return(dt);
        }
Example #2
0
        void dgvLstComptes_SelectionChanged(object sender, System.EventArgs e)
        {
            if (dgvLstComptes.SelectedRows.Count == 0)
            {
                dgvLstOperations.DataSource = null;
                return;
            }

            CritereRechercheOperation crtRechercheOperation = new CritereRechercheOperation();

            crtRechercheOperation.IdCompte = (int)dgvLstComptes.SelectedRows[0].Cells[0].Value;
            dgvLstOperations.DataSource    = BSGestionClient.RechercherOperations(crtRechercheOperation);
        }
Example #3
0
        private static IDataReader get(CritereRechercheOperation criteres)
        {
            IList <string> champsWhere = new List <string>();
            IList <object> valuesWhere = new List <object>();
            IList <string> operators   = new List <string>();

            Utilities.addCritere(champsWhere, valuesWhere, operators, "LIBELLE", criteres.Libelle, Connexion.LIKE);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "TYPE_OPERATION", criteres.TypeOperation, Connexion.LIKE);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "STATUT", criteres.Statut, Connexion.LIKE);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "DT_OPERATION", criteres.DateOperationFin, Connexion.INFEGAL);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "DT_OPERATION", criteres.DateOperationDebut, Connexion.SUPEGAL);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "ID_OPERATION", criteres.IdOperation, Connexion.EGAL);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "ID_MOYEN_PAIEMENT", criteres.IdMoyenPaiement, Connexion.EGAL);
            Utilities.addCritere(champsWhere, valuesWhere, operators, "ID_COMPTE", criteres.IdCompte, Connexion.EGAL);
            //Utilities.addCritere(champsWhere, valuesWhere, operators, criteres.isCredit() ? "MNT_CREDIT" : "MNT_DEBIT", "NOT NULL" , Connexion.IS);
            return(Connexion.get(tableName, champsWhere, valuesWhere, operators));
        }
        private bool initCritereRecherche()
        {
            crtRechercheOperation         = new CritereRechercheOperation();
            crtRechercheOperation.Libelle = txtLibelle.Text;
            if (!string.IsNullOrEmpty(txtId.Text))
            {
                try
                {
                    crtRechercheOperation.IdOperation = long.Parse(txtId.Text);
                }
                catch
                {
                    Utilities.showErrorMessage("L'ID de l'operation n'a pas été saisi correctement", "Erreur");
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(txtIdCompte.Text))
            {
                try
                {
                    crtRechercheOperation.IdCompte = long.Parse(txtIdCompte.Text);
                }
                catch
                {
                    Utilities.showErrorMessage("L'ID du compte n'a pas été saisi correctement", "Erreur");
                    return(false);
                }
            }
            if (!string.IsNullOrEmpty(txtIdMoyenPaiement.Text))
            {
                try
                {
                    crtRechercheOperation.IdMoyenPaiement = long.Parse(txtIdMoyenPaiement.Text);
                }
                catch
                {
                    Utilities.showErrorMessage("L'ID du compte n'a pas été saisi correctement", "Erreur");
                    return(false);
                }
            }


            if (cbStatut.SelectedIndex == 1)
            {
                crtRechercheOperation.Statut = "EnCours";
            }
            if (cbStatut.SelectedIndex == 2)
            {
                crtRechercheOperation.Statut = "Realise";
            }

            switch (cbDate.SelectedIndex)
            {
            case 0: break;

            case 1:
                crtRechercheOperation.DateOperationDebut = dtDateDebut.Value;
                crtRechercheOperation.DateOperationFin   = dtDateDebut.Value;
                break;

            case 2:
                crtRechercheOperation.DateOperationDebut = dtDateDebut.Value;
                break;

            case 3:
                crtRechercheOperation.DateOperationFin = dtDateFin.Value;
                break;

            case 4:
                crtRechercheOperation.DateOperationDebut = dtDateDebut.Value;
                crtRechercheOperation.DateOperationFin   = dtDateFin.Value;
                break;
            }
            return(true);
        }