Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

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 Account_Registration

public delegate long DelegateNumber(long number);

public delegate string DelegateText(string txt);

class StudentInfoClass

public static string FirstName, LastName, MiddleName, Address, Program;

public static long Age = 0;

public static long ContactNo = 0;

public static long StudentNo = 0;

public static string GetFirstName(string FirstName)

return FirstName;

public static string GetLastName(string LastName)

return LastName;
}

public static string GetMiddleName(string MiddleName)

return MiddleName;

public static string GetAddress(string Address)

return Address;

public static string GetProgram(string Program)

return Program;

public static long GetAge(long Age)

return Age;

public static long GetContactNo(long ContactNo)

return ContactNo;

public static long GetStudentNo(long StudentNo)

return StudentNo;

public partial class FrmRegistration : Form


{

public FrmRegistration()

InitializeComponent();

comboBox1.Items.Add("BS of Business Administration");

comboBox1.Items.Add("BS in Hospitality Management");

comboBox1.Items.Add("BS of Information Technology");

comboBox1.Items.Add("BS in Computer Science");

private void button1_Click(object sender, EventArgs e)

StudentInfoClass.StudentNo = long.Parse(textBox1.Text);

StudentInfoClass.Program = comboBox1.Text.ToString();

StudentInfoClass.LastName = textBox2.Text;

StudentInfoClass.FirstName = textBox3.Text;

StudentInfoClass.MiddleName = textBox4.Text;

StudentInfoClass.Age = long.Parse(textBox5.Text);

StudentInfoClass.ContactNo = long.Parse(textBox6.Text);

StudentInfoClass.Address = textBox7.Text;

using (FrmConfirm frmConfirm = new FrmConfirm())

if (frmConfirm.ShowDialog() == DialogResult.OK)

textBox1.Clear();

comboBox1.SelectedIndex = -1;

textBox2.Clear();

textBox3.Clear();
textBox4.Clear();

textBox5.Clear();

textBox6.Clear();

textBox7.Clear();

}
using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;
using System.Reflection.Emit;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace Account_Registration

public partial class FrmConfirm: Form

private DelegateText DelProgram, DelLastName, DelFirstName, DelMiddleName, DelAddress;

private void FrmConfirm_Load(object sender, EventArgs e)

label9.Text = DelStudentNo(StudentInfoClass.StudentNo).ToString();

label10.Text = DelProgram(StudentInfoClass.Program);

label11.Text = DelLastName(StudentInfoClass.LastName);

label12.Text = DelFirstName(StudentInfoClass.FirstName);

label13.Text = DelMiddleName(StudentInfoClass.MiddleName).ToString();

label14.Text = DelAge(StudentInfoClass.Age).ToString();

label15.Text = DelContactNo(StudentInfoClass.ContactNo).ToString();

label16.Text = DelAddress(StudentInfoClass.Address);

private DelegateNumber DelAge, DelContactNo, DelStudentNo;

public FrmConfirm()

InitializeComponent();

DelProgram = new DelegateText(StudentInfoClass.GetProgram);


DelLastName = new DelegateText(StudentInfoClass.GetLastName);

DelFirstName = new DelegateText(StudentInfoClass.GetFirstName);

DelMiddleName = new DelegateText(StudentInfoClass.GetMiddleName);

DelAddress = new DelegateText(StudentInfoClass.GetAddress);

DelAge = new DelegateNumber(StudentInfoClass.GetAge);

DelContactNo = new DelegateNumber(StudentInfoClass.GetContactNo);

DelStudentNo = new DelegateNumber(StudentInfoClass.GetStudentNo);

private void button1_Click(object sender, EventArgs e)

this.DialogResult = DialogResult.OK;

this.Close();

You might also like