0% found this document useful (0 votes)
89 views4 pages

Admission System Code

This document contains code for a C# Windows Forms application for university admission. It defines classes and methods to populate dropdown lists for departments, degrees, and seats. It handles events for selecting items and calculating a student's merit based on entered marks to display a submission summary. Methods are included to clear the form fields and exit the application.

Uploaded by

Muhammad Adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views4 pages

Admission System Code

This document contains code for a C# Windows Forms application for university admission. It defines classes and methods to populate dropdown lists for departments, degrees, and seats. It handles events for selecting items and calculating a student's merit based on entered marks to display a submission summary. Methods are included to clear the form fields and exit the application.

Uploaded by

Muhammad Adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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 Addmission_System
{
public partial class frmAddmission : Form
{
public frmAddmission()
{
InitializeComponent();
}

private void frmAddmission_Load(object sender, EventArgs e)


{
LstDep.Items.Add("Department of Computer Science");
LstDep.Items.Add("Department of Information Tecnology");
LstDep.Items.Add("Department of Math");
LstDep.Items.Add("Department of Telecommunication");
LstDep.Items.Add("Department of English");
LstDep.Items.Add("Department of Urdu");
LstDep.Items.Add("Department of Physics");
LstDep.Items.Add("Dapartment of Stat");
LstDep.Sorted = true;

LstSeats.Items.Add("Open Merit");
LstSeats.Items.Add("Special Qouta");
LstSeats.Items.Add("Sports");
LstSeats.Items.Add("FATA Seats");
LstSeats.Items.Add("Employee Seats");
LstSeats.Items.Add("Oversease Seats");

LstSeats.Sorted = true;

private void groupBox5_Enter(object sender, EventArgs e)


{
//You Appllied at the Department of Computer Science in BS (CS), using
opent merit, Reserve seats..

private void LstDep_SelectedIndexChanged_1(object sender, EventArgs e)


{
if (LstDep.SelectedItem == null)
return;
string dep = LstDep.SelectedItem.ToString();

lstDegree.Items.Clear();

if (dep == "Department of Computer Science")


{
lstDegree.Items.Add("BS (CS)");
lstDegree.Items.Add("MCS");
lstDegree.Items.Add("MS (Cs)");
lstDegree.Items.Add("PHD (CS)");
}
else if (dep == "Department of Information Tecnology")
{
lstDegree.Items.Add("BS (IT)");
lstDegree.Items.Add("MIT");
lstDegree.Items.Add("MS (IT)");
lstDegree.Items.Add("PHD (IT)");
}
else if (dep == "Department of Math")
{
lstDegree.Items.Add("BS (Math)");
lstDegree.Items.Add("MSc (Math)");
lstDegree.Items.Add("M.Phil (Math)");
lstDegree.Items.Add("PHD (Math)");
}
else if (dep == "Department of Telecommunication")
{
lstDegree.Items.Add("BS (TC)");
lstDegree.Items.Add("MTC");
lstDegree.Items.Add("M.Phil (TC)");
lstDegree.Items.Add("PHD (TC)");
}
else if (dep == "Department of English")
{
lstDegree.Items.Add("BS (English)");
lstDegree.Items.Add("MSc (English)");
lstDegree.Items.Add("M.Phil (English)");
lstDegree.Items.Add("PHD (English)");
}
else if (dep == "Department of Urdu")
{
lstDegree.Items.Add("BS (Urdu)");
lstDegree.Items.Add("MSc (Urdu)");
lstDegree.Items.Add("M.Phil (Urdu)");
lstDegree.Items.Add("PHD (Urdu)");
}
else if (dep == "Department of Physics")
{
lstDegree.Items.Add("BS (Physics)");
lstDegree.Items.Add("MSc (Physics)");
lstDegree.Items.Add("M.Phil (Physics)");
lstDegree.Items.Add("PHD (Physics)");
}
else if (dep == "Dapartment of Stat")
{
lstDegree.Items.Add("BS (Stat)");
lstDegree.Items.Add("MSc (Stat)");
lstDegree.Items.Add("M.Phil (Stat)");
lstDegree.Items.Add("PHD (Stat)");
}
}

private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)


{

private void btnSubmit_Click(object sender, EventArgs e)


{
double mo, mt, io, it, go, gt, mp, ip, gp,merit;
string dep = LstDep.SelectedItem.ToString();
string degree = lstDegree.SelectedItem.ToString();
string seat = "";
for (int i=0; i<LstSeats.CheckedItems.Count; i++)
{
seat = LstSeats.CheckedItems[i].ToString();
}
mo = Convert.ToDouble(MObM.Text);
mt = Convert.ToDouble(MTlM.Text);
io = Convert.ToDouble(EObM.Text);
it = Convert.ToDouble(ETlM.Text);
go = Convert.ToDouble(GObM.Text);
gt = Convert.ToDouble(GTlM.Text);

if(chkHafiz.Checked)
{
go = go + 20;
}
if(chkCS.Checked)
{
go = go + 10;
}
mp = (mo * 100) / mt;
ip = (io * 100) / it;
gp = (go * 100) / gt;

merit = (mp*.30) + (ip*.30) + (gp*.40);


if (LstDep.SelectedIndex == -1)
{
MessageBox.Show("No Department Selected.\n Please select department
first");
return;
}
if(lstDegree.SelectedIndex==-1)
{
MessageBox.Show("No Program Selected.\n Please select Program
first");
return;
}
if(LstSeats.CheckedItems==null)
{
MessageBox.Show("No Seat Selected.\n Please select seat first");
return;
}

MessageBox.Show("You Applied for \n Department: " +dep + "\nDegree: "


+degree + "\n Under Seat: " +seat +"\n Your Merit is: " +merit + "\n Your
Application submitted Successfuly, \n Please wait for our next Instruction.");
}

private void btnClear_Click(object sender, EventArgs e)


{
txt1.Clear();
txt2.Clear();
txt3.Clear();
txt5.Clear();
txt6.Clear();
txt8.Clear();
txt9.Clear();
txt10.Clear();
txt11.Clear();
MObM.Clear();
MTlM.Clear();
txt15.Clear();
txt16.Clear();
EObM.Clear();
ETlM.Clear();
txt20.Clear();
txt21.Clear();
GObM.Clear();
GTlM.Clear();
LstDep.SelectedIndex = -1;
lstDegree.SelectedIndex = -1;
}

private void btnExit_Click(object sender, EventArgs e)


{
Application.Exit();
}
}
}

You might also like