Professional Documents
Culture Documents
Assign#3 Sol
Assign#3 Sol
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 AdmissionForm
{
public partial class Form1 : Form
{
public Form1()
{ InitializeComponent(); }
listProg.Items.Add("BSCS");
listProg.Items.Add("MCS");
listProg.Items.Add("MIT");
listProg.Items.Add("BS(TS)");
applicationNo.Enabled = false;
name.Enabled = false;
matricObMarks.Enabled = false;
matricToMarks.Enabled = false;
fscObMarks.Enabled = false;
fscToMarks.Enabled = false;
bscObMarks.Enabled = false;
bscToMarks.Enabled = false;
}
Page | 1
private void listProg_SelectedIndexChanged(object sender, EventArgs e)
{
if (listDepart.SelectedIndex == -1)
{
MessageBox.Show("Please First Select The Department");
}
else if (listDepart.SelectedIndex == 0 && listProg.SelectedIndex == 0)
{
MessageBox.Show("Enter The Data");
applicationNo.Enabled = true;
name.Enabled = true;
fscObMarks.Enabled = true;
fscToMarks.Enabled = true;
bscObMarks.Enabled = false;
bscToMarks.Enabled = false;
matricObMarks.Enabled = false;
matricToMarks.Enabled = false;
}
else if (listDepart.SelectedIndex == 0 && listProg.SelectedIndex == 1)
{
MessageBox.Show("Enter The Data");
applicationNo.Enabled = true;
name.Enabled = true;
matricObMarks.Enabled = true;
matricToMarks.Enabled = true;
fscObMarks.Enabled = true;
fscToMarks.Enabled = true;
bscObMarks.Enabled = true;
bscToMarks.Enabled = true;
}
else if (listDepart.SelectedIndex == 1 && listProg.SelectedIndex == 2)
{
MessageBox.Show("Enter The Data");
applicationNo.Enabled = true; name.Enabled = true;
matricObMarks.Enabled = true;
matricToMarks.Enabled = true;
fscObMarks.Enabled = true;
fscToMarks.Enabled = true;
bscObMarks.Enabled = true; bscToMarks.Enabled = true;
}
Page | 2
else if (listDepart.SelectedIndex == 2 && listProg.SelectedIndex == 3)
{
MessageBox.Show("Enter The Data");
applicationNo.Enabled = true;
name.Enabled = true;
fscObMarks.Enabled = true;
fscToMarks.Enabled = true;
bscObMarks.Enabled = false;
bscToMarks.Enabled = false;
matricObMarks.Enabled = false;
matricToMarks.Enabled = false;
}
else
{
MessageBox.Show("Invalid Selection:Please Select Again");
}
}
Page | 3
}
}
else if ((listDepart.SelectedIndex == 0 && listProg.SelectedIndex == 1) ||
(listDepart.SelectedIndex == 1 && listProg.SelectedIndex == 2))
{
double matricObtainMarks, matricTotalMarks, fscObtainMarks,
fscTotalMarks, bscObtainMarks, bscTotalMarks,totalobtain;
matricObtainMarks = Convert.ToDouble(matricObMarks.Text);
matricTotalMarks = Convert.ToDouble(matricToMarks.Text);
fscObtainMarks = Convert.ToDouble(fscObMarks.Text);
fscTotalMarks = Convert.ToDouble(fscToMarks.Text);
bscObtainMarks = Convert.ToDouble(bscObMarks.Text);
bscTotalMarks = Convert.ToDouble(bscToMarks.Text);
Page | 4
applicationNo.Clear();
name.Clear();
matricObMarks.Clear();
matricToMarks.Clear();
fscObMarks.Clear();
fscToMarks.Clear();
bscObMarks.Clear();
bscToMarks.Clear();
merit.Clear();
remarks.Clear();
listDepart.SelectedIndex = -1;
listProg.SelectedIndex = -1;
applicationNo.Enabled = false;
name.Enabled = false;
matricObMarks.Enabled = false;
matricToMarks.Enabled = false;
fscObMarks.Enabled = false;
fscToMarks.Enabled = false;
bscObMarks.Enabled = false;
bscToMarks.Enabled = false;
}
Page | 5
Page | 6