07-05-2011, 02:48 PM
SMSMainForm.cs
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace SchoolManagementSystem
{
public partial class SMSMainForm : Form
{
OleDbConnection cn = new OleDbConnection(ConnectionStringForSMS.MyConnectionString());
public static int i;
public SMSMainForm()
{
InitializeComponent();
}
private void SMSMainForm_Load(object sender, EventArgs e)
{
OleDbDataAdapter da = new OleDbDataAdapter("select schooltitle,Address from schooltitle", cn);
DataSet ds = new DataSet();
da.Fill(ds);
string schooltitle = ds.Tables[0].Rows[0].ItemArray[0].ToString();
string address = ds.Tables[0].Rows[0].ItemArray[1].ToString();
this.Text = schooltitle + "--MainWindow";
label5.Text = "";
label5.Text = schooltitle;
this.KeyDown+=new KeyEventHandler(SMSMainForm_KeyDown);
}
private void pictureBox1_Click(object sender, EventArgs e)
{
SettringsForm setf = new SettringsForm();
setf.Show();
}
private void pictureBox2_Click(object sender, EventArgs e)
{
EntryForm ef = new EntryForm();
ef.Show();
}
private void pictureBox3_Click(object sender, EventArgs e)
{
ReportsForm rf = new ReportsForm();
rf.Show();
}
private void pictureBox4_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(ConnectionStringForSMS.help1());
}
private void pictureBox5_Click(object sender, EventArgs e)
{
frmcreateuser nuser = new frmcreateuser();
nuser.Show();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
SettringsForm setf = new SettringsForm();
setf.Show();
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
EntryForm ef = new EntryForm();
ef.Show();
}
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
frmcreateuser nuser = new frmcreateuser();
nuser.Show();
}
private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(ConnectionStringForSMS.help1());
}
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
ReportsForm rf = new ReportsForm();
rf.Show();
}
private void pictureBox1_Click_1(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(ConnectionStringForSMS.help1());
}
private void pictureBox2_Click_1(object sender, EventArgs e)
{
this.Close();
EntryForm ef = new EntryForm();
ef.Show();
}
private void pictureBox4_Click_1(object sender, EventArgs e)
{
this.Close();
SettringsForm setf = new SettringsForm();
setf.Show();
}
private void pictureBox3_Click_1(object sender, EventArgs e)
{
this.Close();
ReportsForm rf = new ReportsForm();
rf.Show();
}
private void pictureBox5_Click_1(object sender, EventArgs e)
{
this.Close();
frmcreateuser nuser = new frmcreateuser();
nuser.Show();
}
private void SMSMainForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
Application.Exit();
}
}
private void button1_Click_1(object sender, EventArgs e)
{
frmUpdatedToNextYear futny = new frmUpdatedToNextYear();
futny.Show();
}
}
}