Ejemplo n.º 1
0
        private void dismissStripButton_Click(object sender, EventArgs e)
        {
            AnketaUvolitForm tmpform = new AnketaUvolitForm();

            tmpform.Owner = this;
            DialogResult dRes = tmpform.ShowDialog(this);

            if (dRes == DialogResult.OK)
            {
                List <DataRowView> persons      = GetSelectedRows();
                List <long>        personIdList = new List <long>();
                foreach (DataRowView rowItem in persons)
                {
                    personIdList.Add((long)rowItem[PersonView.id]);
                }

                PersonOrg.SetStateToUvolit(personIdList, _org.idVal, tmpform.DismissDate, _connection);
                foreach (DataRowView rowItem in persons)
                {
                    rowItem[PersonView.state]       = (int)PersonView.PersonState.Uvolen;
                    rowItem[PersonView.dismissDate] = tmpform.DismissDate;
                    rowItem[Check] = false;
                    rowItem.EndEdit();
                }
                _personBS.MoveFirst();
            }
        }
Ejemplo n.º 2
0
 private void FirstClient_Click(object sender, EventArgs e)
 {
     bs.DataSource = null;
     dgvClientManagement.DataSource = null;
     bs.DataSource = clientTable;
     dgvClientManagement.DataSource = bs;
     bs.MoveFirst();
 }
Ejemplo n.º 3
0
 private void Enable_Binding()
 {
     txt_Num_Etu.DataBindings.Add("Text", bs, "Num_Etu");
     txt_Nom_Etu.DataBindings.Add("Text", bs, "Nom_Etu");
     txt_Prenom_Etu.DataBindings.Add("Text", bs, "Prenom_Etu");
     dt_DateN_Etu.DataBindings.Add("Value", bs, "DateN_Etu");
     bs.MoveFirst();
 }
Ejemplo n.º 4
0
                /**/ lblMontant.Text = frmAjoutTransac.FormatDuMontant(lblMontant.Text); lblMontant.Text += " €";
                chkRecette.DataBindings.Clear(); chkRecette.DataBindings.Add("Checked", bs, "recetteON");
                chkPercu.DataBindings.Clear(); chkPercu.DataBindings.Add("Checked", bs, "percuON");

                lblType.Text           = typeTranscation[(int)ds.Tables["_Transaction"].Rows[0][6]];
                lblEnregistrement.Text = "Enregistrement " + 1 + " / " + bs.Count;

                bs.MoveFirst();
            }
            else
            {
                MessageBox.Show("Il n'y a pas de transaction dans la base de donnée !");
            }
        }

        /* Lance la liaison de donnée vers les personnes*/
        private void CliquerSurLiaisonPersonne(object sender, EventArgs e)
        {
            // Changer le titre de la fenêtre, et changer le tab (a suppr ? si y'a plus de titre ?)

            lblTitre.Text            = "Récapitulatif : Personnes";
            lblTitre.Left            = Width / 2 - lblTitre.Width / 2;
            tabControl1.SelectedTab  = tabPersonne;
            btnPersonne.BackColor    = Color.Red;
            btnPersonne.Font         = new Font(btnPersonne.Font, FontStyle.Bold);
            btnTransaction.BackColor = Color.White;
            btnTransaction.Font      = new Font(btnTransaction.Font, FontStyle.Regular);

            // Retirer les autres liaisons en cours

            lblId.DataBindings.Clear();
            lblDate.DataBindings.Clear();
            lblDescription.DataBindings.Clear();
            lblMontant.DataBindings.Clear();
            chkRecette.DataBindings.Clear();
            chkPercu.DataBindings.Clear();
            lblType.DataBindings.Clear();

            if (premierPersonne)
            {
                premierPersonne = false;

                // Création de la source de donnée pour les personnes

                new OleDbDataAdapter(new CMD(@"SELECT * FROM Personne", frmMain.con)).Fill(ds, "_Personne");

                // Activation des boutons de navigation

                _btnLL.Enabled = true;
                _btnL.Enabled  = true;
                _btnR.Enabled  = true;
                _btnRR.Enabled = true;
            }

            if (ds.Tables["_Personne"].Rows.Count != 0)
            {
                bs.DataSource = ds.Tables["_Personne"];

                // Liaison de donnée

                lblIdPersonne.DataBindings.Clear(); lblIdPersonne.DataBindings.Add("Text", bs, "codePersonne");
                lblNom.DataBindings.Clear(); lblNom.DataBindings.Add("Text", bs, "nomPersonne");
                lblPrenom.DataBindings.Clear(); lblPrenom.DataBindings.Add("Text", bs, "pnPersonne");
                lblTelephone.DataBindings.Clear(); lblTelephone.DataBindings.Add("Text", bs, "telMobile");

                _lblEnregistrement.Text = "Enregistrement " + 1 + " / " + bs.Count;

                bs.MoveFirst();
            }
            else
            {
                MessageBox.Show("Il n'y a pas de transaction dans la base de donnée !");
            }
        }
Ejemplo n.º 5
0
 public void remplir_liste()
 {
     dgv_liste_clt.AutoGenerateColumns = false;
     //_dt_liste_Fournisseur = CLIENT_APP_PARAM.GEST.P_FOURNISSEUR.SELECT_ALL_FOURNISSEURS();
     _dt_liste_Fournisseur      = CLIENT_APP_PARAM.gcws.SELECT_ALL_FOURNISSEURS();
     _bs_fournisseur.DataSource = _dt_liste_Fournisseur;
     dgv_liste_clt.DataSource   = _bs_fournisseur;
     _bs_fournisseur.MoveFirst();
 }
 private void btnNext_Click(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex == listBox1.Items.Count - 1)
     {
         bsCat.MoveFirst();
     }
     else
     {
         bsCat.MoveNext();
     }
 }
Ejemplo n.º 7
0
        // ----------------------------------
        // ---Déplacement du BindingSource---
        // ----------------------------------

        private void CliquerSurPremierTransaction(object sender, EventArgs e)
        {
            bs.MoveFirst();
            lblType.Text           = typeTransaction[(int)ds.Tables["_Transaction"].Rows[0][6]];
            lblMontant.Text       += !lblMontant.Text.Contains('€') ? " €" : "";
            lblEnregistrement.Text = "Enregistrement " + (bs.Position + 1) + " / " + bs.Count;
            if (ds.Tables["_Beneficiaires"] != null)
            {
                ds.Tables["_Beneficiaires"].Clear();
            }
            new OleDbDataAdapter(new CMD(@"SELECT p.codePersonne, p.nomPersonne, p.pnPersonne FROM Personne p, Beneficiaires b
                WHERE b.codePersonne = p.codePersonne AND b.codeTransaction = " + lblId.Text, con)).Fill(ds, "_Beneficiaires");
            dataGridView1.DataSource = ds.Tables["_Beneficiaires"];
        }
Ejemplo n.º 8
0
        private void fPhieuGiaohang_Load(object sender, EventArgs e)
        {
            bs.DataSource           = _data.ds;
            this.bs.CurrentChanged += new EventHandler(bs_CurrentChanged);
            this.bs.DataMember      = _data.mt.TableName;

            this.gcMt.DataSource = bs;
            gcDt.DataSource      = bs;
            gcDt.DataMember      = _data.ds.Relations[0].RelationName;
            bs_CurrentChanged(bs, new EventArgs());
            if (bs.Count > 0)
            {
                bs.MoveFirst();
            }
            this.KeyDown += new KeyEventHandler(fPhieuGiaohang_KeyDown);
        }
Ejemplo n.º 9
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     if (_bindingSource != null)
     {
         _bindingSource.MoveFirst();
     }
 }
Ejemplo n.º 10
0
 private void btnPrim_Click(object sender, EventArgs e)
 {
     // move o ponteiro de registros para a primeira posição da tabela virtual - memória
     bs_clientes.MoveFirst();
     // atualiza os campos do formulário com o registro posicionado na memória
     igualar_text();
 }
        public void initializationInvestProject()
        {
            BindingSource    bindingSource = new BindingSource();
            InvestProjectDAO dao           = new InvestProjectDAO();

            bindingSource.Clear();
            bindingSource.DataSource          = dao.getAll();
            dataGridInvestProject.DataSource  = bindingSource;
            bindingSource.CurrentItemChanged += BindingSource_CurrentItemChanged;

            if ((ScrollIndex >= 0) && (dataGridInvestProject.Rows.Count > 0))
            {
                dataGridInvestProject.FirstDisplayedScrollingRowIndex = ScrollIndex;
            }
            if (BookMarkInvestProject != 0)
            {
                dataGridInvestProject.Rows[BookMarkInvestProject].Selected = true;
                bindingSource.Position = BookMarkInvestProject;
            }
            else
            {
                if (bindingSource.Count > 0)
                {
                    bindingSource.MoveNext();
                    bindingSource.MoveFirst();
                }
                //dataGridInvestProject.Rows[1].Selected = true;
            }
        }
Ejemplo n.º 12
0
 private void CHM_COMPTE_CREDIT_CLIENT_Shown(object sender, EventArgs e)
 {
     try
     {
         //CLIENT_APP_PARAM.GEST.P_COMPTE_CLIENT.actualiser_compte(CODE_CLIENT);
         if (CODE_CLIENT == null || CODE_CLIENT == string.Empty)
         {
             throw new Exception("Code client invalid!");
         }
         CLIENT_APP_PARAM.gcws.actualiser_compte(CODE_CLIENT);
         //dt = CLIENT_APP_PARAM.GEST.P_COMPTE_CLIENT.LOAD_COMPTE_CLIENT(CODE_CLIENT);
         dt            = CLIENT_APP_PARAM.gcws.LOAD_COMPTE_CLIENT(CODE_CLIENT);
         bs.DataSource = dt;
         bs.MoveFirst();
         if (bs.Current != null)
         {
             DataRowView drv = (DataRowView)bs.Current;
             CODE_COMPTE     = drv["CODE_COMPTE_CLIENT"].ToString();
             NUM_COMPTE.Text = drv["NUM_COMPTE_CLIENT"].ToString();
             CREDIT.Text     = drv["TOTAl_CREDIT_CLT"].ToString();
             PAYE.Text       = drv["TOTAL_PAYE_CLT"].ToString();
         }
         //dt_clt = CLIENT_APP_PARAM.GEST.P_CLIENT.LOAD_CLIENT(CODE_CLIENT);
         dt_clt            = CLIENT_APP_PARAM.gcws.LOAD_CLIENT(CODE_CLIENT);
         bs_clt.DataSource = dt_clt;
         DataRowView dr = (DataRowView)bs_clt.Current;
         CLIENT.Text = dr["RS_CLIENT"].ToString();
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message, this.Text);
         this.Close();
     }
 }
Ejemplo n.º 13
0
 private void btnSuppr_Click(object sender, EventArgs e)
 {
     try
     {
         var filteredData = Modele.MaConnexion.LigneFraisHorsForfait.ToList()
                            .Where(x => x.id == (int.Parse(dgvAutresFrais.SelectedRows[0].Cells[0].Value.ToString())));
         if (filteredData.Count() > 0)
         {
             BindingSource bsMaLigne = new BindingSource();
             bsMaLigne.DataSource = filteredData; // application du filtre
             LigneFraisHorsForfait maLigne = new LigneFraisHorsForfait();
             bsMaLigne.MoveFirst();
             maLigne = (LigneFraisHorsForfait)bsMaLigne.Current;
             Modele.MaConnexion.LigneFraisHorsForfait.Remove(maLigne);
             Modele.MaConnexion.SaveChanges();
             chargement();
             MessageBox.Show("Ligne supprimé");
         }
         else
         {
             MessageBox.Show("Aucune ligne sélectionnée");
         }
     }
     catch
     {
         MessageBox.Show("Aucune ligne sélectionnée");
     }
 }
Ejemplo n.º 14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //Set params
            DateTime dtStartDate    = dtpStartDate.Value;
            DateTime dtExpiryDate   = dtpExpiryDate.Value;
            string   sPaymentMethod = txtPaymentMethod.Text;
            string   sDepositPaid   = ddlDepositPaid.Text;
            int      iClientId      = int.Parse(ddlClient.SelectedValue.ToString());
            int      iPropertyId    = int.Parse(ddlProperty.SelectedValue.ToString());

            try
            {
                int iNewLeaseNumber = InsertLease(dtStartDate, dtExpiryDate, sPaymentMethod, sDepositPaid, iClientId, iPropertyId);
                lblNumber.Text = iNewLeaseNumber.ToString();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.ToString());
            }
            finally
            {
                conn.Close();//Just making 100% sure the connetion closes
            }
            //Set controls
            btnEditLease.Enabled = true;
            btnDelete.Enabled    = true;
            bsLease.MoveFirst();
        }
Ejemplo n.º 15
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            // If you are not at the end of the list, move to the next item
            // in the BindingSource.
            while (true)
            {
                if (_customerBindingSource.Position + 1 < _customerBindingSource.Count)
                {
                    DataRowView curr = (DataRowView)_customerBindingSource.Current;
                    string      str  = curr[3].ToString();
                    if (str.IndexOf("'", 0, StringComparison.Ordinal) >= 0)
                    {
                        str = str.Remove(0, 1);
                        // str = str.Remove(str.Length - 1);
                        curr[3] = str;
                    }

                    _customerBindingSource.MoveNext();
                }
                // Otherwise, move back to the first item.
                else
                {
                    _customerBindingSource.MoveFirst();
                    break;
                }
            }

            // Force the form to repaint.
            this.Invalidate();
        }
Ejemplo n.º 16
0
        /*
         * afficherRes : void       : met à jour les données affichées lorsque l'on clique sur un bouton
         * Entrée :
         *      sender : object     : bouton sur lequel l'utilisateur a appuyé
         *           e : EventArgs  : évènement (ex : click sur le bouton)
         * Sortie :
         *      void
         */
        private void afficherRes(object sender, EventArgs e)
        {
            //on récupère le bouton sur lequel l'utilisateur a appuyé
            Button b = (Button)sender;

            //selon le bouton on avance, recule, ou bien affichons la première/dernière transaction
            if (b == btnPremier)
            {
                transactionsBS.MoveFirst();
            }
            else if (b == btnPrecedent)
            {
                transactionsBS.MovePrevious();
            }
            else if (b == btnSuivant)
            {
                transactionsBS.MoveNext();
            }
            else if (b == btnDernier)
            {
                transactionsBS.MoveLast();
            }

            //on met à jour le numéro de transaction, ainsi que les personnes concernées
            lblPage.Text = string.Format(Program.settings.localize.Translate("page_{0}_of_{1}"),
                                         transactionsBS.Position + 1, transactionsBS.Count);
            updatePersonnes();
        }
Ejemplo n.º 17
0
        public fCheckOut(string MT62ID)
        {
            InitializeComponent();
            _MT62ID = MT62ID;
            string sql = "select getdate()";

            ngayht                  = _dbData.GetValue(sql);
            _data                   = new DataCheckOut(MT62ID);
            bs.DataSource           = _data.ds;
            bs.DataMember           = _data.ds.Tables[1].TableName;
            bs.CurrentChanged      += new EventHandler(bs_CurrentChanged);
            gridControl1.DataSource = bs;
            bs.MoveFirst();
            bs_CurrentChanged(bs, new EventArgs());

            //Biding
            GetBinding();
            GetData4Lookup();
            repositoryItemGridLookUpEdit1.DataSource        = _data.dmVT;
            repositoryItemGridLookUpEdit1.EditValueChanged += new EventHandler(repositoryItemGridLookUpEdit1_EditValueChanged);
            repositoryItemGridLookUpEdit2.DataSource        = _data.dmDV;
            gridView2.FocusedRowChanged      += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gridView2_FocusedRowChanged);
            gridLookUpEdit1.EditValueChanged += new EventHandler(gridLookUpEdit1_EditValueChanged);
            gridView1.MouseUp += new MouseEventHandler(gridView1_MouseUp);
        }
Ejemplo n.º 18
0
        private void cboMois_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                var LQuery = Modele.MaConnexion.fichefrais.ToList()
                             .Where(x => x.idVisiteur == cboMois.SelectedValue.ToString());
                BindingSource bs = new BindingSource();
                bs.DataSource = LQuery;
                bs.MoveFirst();
                fichefrais            ffrais = (fichefrais)bs.Current;
                LigneFraisHorsForfait lhf    = (LigneFraisHorsForfait)bs.Current;
                cboMois.DataSource = ffrais.mois;


                // affiche dans la dgv les éléments forfaitisés
                bsMois.DataSource                     = LQuery;
                txtNbJustif.Text                      = ffrais.nbJustificatifs.ToString();
                dgvFraisForfait.DataSource            = bsMois;
                dgvFraisForfait.Columns[0].HeaderText = "libelle";
                dgvFraisForfait.Columns[1].HeaderText = "montant";
                dgvFraisForfait.Columns[2].Visible    = false;
                //afiche dans la dgv les éléments hors forfaits
                dgvFraisHorsForfait.DataSource            = bsMois;
                dgvFraisHorsForfait.Columns[0].HeaderText = lhf.libelle;
                dgvFraisHorsForfait.Columns[1].HeaderText = lhf.date.ToString();
                dgvFraisHorsForfait.Columns[2].HeaderText = lhf.montant.ToString();
            }
            catch
            {
            }
        }
Ejemplo n.º 19
0
 private void btnFirst_Click(object sender, EventArgs e)
 {
     if (src != null)
     {
         src.MoveFirst();
         setImage();
     }
 }
Ejemplo n.º 20
0
        private void btn_primeiro_Click_1(object sender, EventArgs e)
        {
            //ponteiro --> primeiro registro
            bs_disc.MoveFirst();

            //iguala os dados
            igualar_text();
        }
Ejemplo n.º 21
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (m_objBindingSrc.Count > 0)
     {
         m_objBindingSrc.RemoveCurrent();
         m_objBindingSrc.MoveFirst();
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 首记录
 /// </summary>
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     bs.MoveFirst();
     _brFrist.Enabled = false;
     _brPrv.Enabled   = false;
     _brNext.Enabled  = true;
     _brLast.Enabled  = true;
 }
Ejemplo n.º 23
0
 private void btnAjout_Click(object sender, EventArgs e)
 {
     // vérifier qu’une ligne est bien sélectionnée dans le dataGridView
     if (dataGV.SelectedRows.Count == 1)
     {
         // appel de la méthode du controleur en mode update et avec la valeur de l’IdPersonne en clé
         Controleur.crud_personne('c', "");
         // mise à jour du dataGridView en affichage
         bindingSource1.MoveLast();
         bindingSource1.MoveFirst();
         dataGV.Refresh();
     }
     else
     {
         MessageBox.Show("Sélectionner une ligne à modifier");
     }
 }
Ejemplo n.º 24
0
 private void BtnCancelar_Click(object sender, EventArgs e)
 {
     BtnNovo.Enabled    = true;
     BtnExcluir.Enabled = true;
     dados.CancelEdit();
     dados.RemoveCurrent();
     dados.MoveFirst();
 }
Ejemplo n.º 25
0
        public CHM_FRM_NV_FACTURE(string code_bl, decimal CODE_MAG)
        {
            InitializeComponent();
            _CODE_B_LIV             = code_bl;
            bs_Detail_fc            = new BindingSource();
            bs_Detail_fc.DataSource = dS_MOUV1.LIGNE_FACTURE;
            gridControl1.DataSource = bs_Detail_fc;
            try
            {
                dt_ligne_facture            = CLIENT_APP_PARAM.gcws.LOAD_SCHEMA_LG_BON_LIVRAISON();
                bs_ligne_facture.DataSource = dt_ligne_facture;
                dataGridViewLG_B_LIV.AutoGenerateColumns = false;
                dataGridViewLG_B_LIV.DataSource          = bs_ligne_facture;


                dt_b_liv_client = CLIENT_APP_PARAM.gcws.LOAD_B_LIV_FACTURE(_CODE_B_LIV);
                CODE_CLIENT     = (decimal)dt_b_liv_client.Rows[0]["CODE_CLIENT"];
                dt_client       = CLIENT_APP_PARAM.gcws.LOAD_CLIENT(CODE_CLIENT.ToString());

                bs_client.DataSource = dt_client;
                bs_client.MoveFirst();
                DataRowView drv_clt = (DataRowView)bs_client.Current;
                REF_CLIENT.Text = drv_clt["REF_CLIENT"].ToString();
                RS_CLIENT.Text  = drv_clt["RS_CLIENT"].ToString();
                TEL_CLIENT.Text = drv_clt["TEL_CLIENT"].ToString();

                TIMBRE.Value = Convert.ToDecimal(CLIENT_APP_PARAM.gcws.GetParamValue("TIMBRE", 1).Replace(',', '.'));

                chargerPieceSansFactureClient(CODE_CLIENT);
                //chargerBonLivraisonClient(CODE_CLIENT);
                //foreach (Control c in p_Commandes_ENCOURS.Controls)
                //{
                //    if (c.Name == _CODE_B_LIV)
                //    {
                //        (c as CHM_SELECTION_CONTROL).selection_state.Checked = true;
                //        break;
                //    }
                //}
                foreach (DataRow dr in dS_MOUV1.V_PIECE_CLIENT_SANS_FACTURE.Rows)
                {
                    if (dr["CODE_PIECE"].ToString() == _CODE_B_LIV)
                    {
                        dr["CHECKED"] = "True";
                        break;
                    }
                }

                rb_periode_CheckedChanged(null, null);

                chM_CMP_VALIDATION1.button1.Click       += new EventHandler(BTN_ENREGISTRER_Click);
                chM_CMP_VALIDATION1.button2.Click       += new EventHandler(button2_Click);
                entete_Formulaire_21.btn_refresh.Visible = false;
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message);
            }
        }
Ejemplo n.º 26
0
 private void btnPrimeiro_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (!VerificarDados())
     {
         return;
     }
     bndVeiculoGrid.MoveFirst();
     Navegar();
 }
Ejemplo n.º 27
0
        public static void MoveFirst(DataTable table)
        {
            BindingSource bs = GetBindingSource(table);

            if (bs != null)
            {
                bs.MoveFirst();
            }
        }
Ejemplo n.º 28
0
        private void CHM_IDENTIFICATION_UTILISATEUR_Shown(object sender, EventArgs e)
        {
            try
            {
                LOGIN_USER.Focus();

                //CLIENT_APP_PARAM.GEST = (CHM_GESTION_COMERCIALE.CHM_GESTION)Activator.GetObject(typeof(CHM_GESTION_COMERCIALE.CHM_GESTION), "tcp://" + CLIENT_APP_PARAM.serveur + ":" + CLIENT_APP_PARAM.port + "/" + CLIENT_APP_PARAM.instance);
                //CLIENT_APP_PARAM.connect();
                //dt = CLIENT_APP_PARAM.GEST.P_UTILISATEUR.RECHERCHE_UTILISATEUR(LOGIN_USER.Text);
                dt            = CLIENT_APP_PARAM.gcws.RECHERCHE_UTILISATEUR(LOGIN_USER.Text);
                bs.DataSource = dt;
                bs.MoveFirst();
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, "Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 29
0
 private void btnDau_Click(object sender, EventArgs e)
 {
     bsBoMon.MoveFirst();
     btnDau.Enabled   = false;
     btnTruoc.Enabled = false;
     btnKe.Enabled    = true;
     btnCuoi.Enabled  = true;
     txtViTri.Text    = (bsBoMon.Position + 1) + " / " + bsBoMon.Count;
 }
Ejemplo n.º 30
0
        private void FirstRecord_Click(object sender, EventArgs e)
        {
            // Переход на первую запись
            bsProizvAvto.MoveFirst();
            int curRecord = bsProizvAvto.Position;

            dataGridView1.CurrentCell.Selected = true;
            dataGridView1.CurrentCell          = dataGridView1[0, curRecord];
        }