Exemplo n.º 1
0
        public void TestValidateTransaction()
        {
            BusinessLayer myBL = new BusinessLayer();

            TransactionTbl myTransaction = new TransactionTbl();

            myTransaction.gl1 = "5540";
            myTransaction.gl2 = "5541";
            myTransaction.gl3 = "1042";
            myTransaction.gl4 = "2142";
            myTransaction.project = "0416";
            myTransaction.fund = "B40";
            myTransaction.customer = 23;
            myTransaction.status = "HELD";
            myTransaction.description = "Record Cash Outlays";
            myTransaction.amount = 50.55;

            Assert.IsTrue(myBL.validateTransaction(myTransaction));
        }
Exemplo n.º 2
0
        public ClientList(Business.BusinessLayer businessLayer)
        {
            InitializeComponent();

            this.businessLayer = businessLayer;

            // Sélection des lignes entières
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            // Ajustement des colonnes en largeur
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            // Utilisation du champ de recherche
            textBox1.TextChanged += (src, evt) =>
            {
                // Données filtrées
                dataGridView1.DataSource = businessLayer.GestionClients.ListeClientsResumée(textBox1.Text.Trim()).ToList();
            };

            // Utilisation du bouton ajouter
            button1.Click += (src, evt) =>
            {
                ((MainForm)Parent.Parent).ChangeView(new ClientEditor(businessLayer));
            };

            // Données initiales non filtrées
            UpdateData();

            // On masque les ID
            dataGridView1.Columns[0].Visible = false;

            // Edition du client
            dataGridView1.CellDoubleClick += this.EditClient;

            // Menu contextuel
            dataGridView1.MouseClick += this.DisplayContextMenu;

            // Focus sur le champ de recherche
            textBox1.Focus();
        }