Advertisement
Lord_Boumedien

Untitled

Dec 5th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Windows.Forms;
  5. using ProjetDOTNET.Models;
  6. namespace ProjetDOTNET.Views.Compte
  7. {
  8. public partial class Ajoutcompte : Form
  9. {
  10. List<Models.Client> tabclient = new List<Models.Client>();
  11.  
  12. public Ajoutcompte()
  13. {
  14. InitializeComponent();
  15.  
  16. }
  17.  
  18. private void Ajoutcompte_Load(object sender, EventArgs e)
  19. {
  20. //NEED TO GET DATA TO TABCLIENT HERE
  21. DataTable table = new DataTable();
  22. table.Columns.Add("ID", typeof(int));
  23. table.Columns.Add("Nom Et Prenom", typeof(string));
  24. table.Columns.Add("Numero Compte", typeof(string));
  25. table.Rows.Add(1, "AAAA", "zzzzz");
  26. table.Rows.Add(2, "BBBB", "BBBB");
  27. table.Rows.Add(3, "CCCC", "CCCC");
  28. dataGridView1.DataSource = table;
  29.  
  30.  
  31. }
  32.  
  33. private void label1_Click(object sender, EventArgs e)
  34. {
  35.  
  36. }
  37.  
  38. private void button1_Click(object sender, EventArgs e)
  39. {
  40. string numcompte = textBox1.Text;
  41. string rib = textBox2.Text;
  42. string type = (radioButton1.Checked) ? "Courant" : "Epargne";
  43. Client c = tabclient[dataGridView1.SelectedRows[0].Index];
  44. Models.Compte compte = new Models.Compte(numcompte, type, rib, 0, c);
  45. //need to save compte here
  46.  
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement