示例#1
0
 private void ValiderAjoutClientbtn_Click(object sender, EventArgs e)
 {
     DAL.Client client = new DAL.Client(clientBox.Text, rueBox.Text, villeBox.Text, Int32.Parse(cpBox.Text), Int32.Parse(telBox.Text));
     BALClient.addClient(client);
     BALClient.loadClients(clients);
     this.Close();
 }
示例#2
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            int res;

            bl           = new BALClient();
            dl           = new Client();
            dl.NumClient = bl.getMaxId() + 1;
            dl.NomClient = txtClient.Text;
            dl.Rue       = txtRue.Text;
            dl.Ville     = txtVille.Text;
            dl.CP        = Int32.Parse(txtCP.Text);
            dl.Tel       = Int32.Parse(txtTel.Text);
            res          = bl.AjouterClient(dl);
            if (res == 1)
            {
                MessageBox.Show("Succès Ajout de nouveau client.");
                ClientAdd win;
                win = new ClientAdd(ch1);
                win.Show();
                this.Dispose();
            }
            else
            {
                MessageBox.Show("Echec Ajout de nouveau client.");
            }
        }
示例#3
0
 public AjoutCmd(DataGridView dgv, DataGridView dgvlig)
 {
     InitializeComponent();
     this.cmddgv    = dgv;
     this.ligcmddgv = dgvlig;
     nbrLigCmd      = this.ligcmddgv.Rows.Count;
     if (this.cmddgv.SelectedRows.Count > 0)
     {
         RefCmdTextBoxAjoutCmd.Text = this.cmddgv.SelectedRows[0].Cells[0].Value.ToString();
         //DateAjoutCmd.Value = this.cmddgv.SelectedRows[0].Cells[0].Value;
         DAL.Client c = BALClient.findById(this.cmddgv.SelectedRows[0].Cells[3].Value.ToString());
         idclient.Text                  = c.id.ToString();
         clientInput.Text               = c.nom;
         RueTextBoxAjoutCmd.Text        = c.rue;
         VilleTextBoxAjoutCmd.Text      = c.ville;
         CodePostalTextBoxAjoutCmd.Text = c.cp.ToString();
         TelTextBoxAjoutCmd.Text        = c.tel.ToString();
         for (int i = 0; i < dgvlig.Rows.Count; i++)
         {
             LignesCmdGrid.Rows.Add(
                 this.ligcmddgv.Rows[i].Cells[0].Value,
                 this.ligcmddgv.Rows[i].Cells[1].Value,
                 this.ligcmddgv.Rows[i].Cells[2].Value,
                 this.ligcmddgv.Rows[i].Cells[3].Value
                 );
         }
     }
     else
     {
         RefCmdTextBoxAjoutCmd.Text = BAL.Global.newGGID();
     }
 }
示例#4
0
 private void find()
 {
     TextBox[] info =
     {
         ClientTextBoxRechClient,
         RueTextBoxRechClient,
         VilleTextBoxRechClient,
         CodePostalTextBoxRechClient,
         telephoneTextBoxRechClient
     };
     BALClient.rechercheClient(dataRechClient, info);
 }
示例#5
0
 private void ListeCommandedgv_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     TextBox[] infoClient = { InfoClient, InfoAdrs, InfoVille, InfoCP, InfoTel };
     BALClient.remplirInfoClient(ListeCommandedgv, infoClient);
 }
示例#6
0
 private void rechercheClient_Load(object sender, EventArgs e)
 {
     BALClient.loadClients(dataRechClient);
 }