Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // osoba
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace WindowsFormsApplication3
- {
- public class Osoba
- {
- public enum Spol
- {
- Ženski,
- Muški
- }
- public Osoba(string Ime, string Prezime, int GodinaRođenja, string Grad, string Email, string Password, DateTime Datum, bool SaPopustom, Spol Spol)
- {
- ime = Ime;
- prezime = Prezime;
- godinaRođenja = GodinaRođenja;
- grad = Grad;
- datumUpisa = Datum;
- email = Email;
- saPopustom = SaPopustom;
- password = Password;
- spol = Spol;
- }
- public string ime
- {
- get;
- set;
- }
- public string prezime
- {
- get;
- set;
- }
- public int godinaRođenja
- {
- get;
- set;
- }
- public string grad
- {
- get;
- set;
- }
- public DateTime datumUpisa
- {
- get;
- set;
- }
- public string email
- {
- get;
- set;
- }
- public bool saPopustom
- {
- get;
- set;
- }
- public string password
- {
- get;
- set;
- }
- public Spol spol
- {
- get;
- set;
- }
- }
- }
- // forma
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication3
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- listaOsoba = new List<Osoba>();
- }
- public List<Osoba> listaOsoba
- {
- get;
- set;
- }
- Osoba.Spol pol
- {
- get;
- set;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- listaOsoba.Add(new Osoba(textBox1.Text, textBox4.Text, int.Parse(textBox2.Text), textBox3.Text, textBox5.Text, maskedTextBox1.Text, DateTime.Now, checkBox1.Checked, pol));
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- }
- private void label3_Click(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox4_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox2_TextChanged_1(object sender, EventArgs e)
- {
- }
- private void textBox3_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox5_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox6_TextChanged(object sender, EventArgs e)
- {
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- pol = Osoba.Spol.Muški;
- }
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
- {
- pol = Osoba.Spol.Ženski;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- foreach(Osoba o in listaOsoba){
- string ispis = "Ime: " + o.ime + " Prezime: " + o.prezime + " Grad: " + o.grad + " Godina rođenja: " + o.godinaRođenja + " Datum upisa: " + o.datumUpisa + " Spol: " + o.spol;
- MessageBox.Show(ispis);
- }
- }
- private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
- {
- maskedTextBox1.Size = new Size(143, 40);
- }
- private void button3_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement