Huwebes, Pebrero 23, 2012

main form

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;


namespace Database_Lecture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}


private void Form1_Load(object sender, EventArgs e)
{
initializeValues();
}


public void PerformRefresh()
{
initializeValues();
}


private void btnAdd_Click(object sender, EventArgs e)

frmAddRecord frmAdd = new frmAddRecord();
frmAdd.ShowDialog(); 
}


private void initializeValues()
{
string query = "Select * from tbl_student_record"; 
clsDatabaseManager obj = new clsDatabaseManager();
obj.fillListView(lsvStudent, query, true, View.Details, 1); 
}












public void refreshValues()
{
initializeValues();
clearAllTextBoxes();


}


private void clearAllTextBoxes()
{
foreach (Control ctl in this.Controls)
{
if (ctl is TextBox)
{
(ctl as TextBox).Clear();
}
}
}




private void lsvStudent_DoubleClick(object sender, EventArgs e)
{
string s;
s = lsvStudent.SelectedItems[0].SubItems[0].Text;
Form2 f2 = new Form2(s,this);
f2.ShowDialog();
}
}
}
val126

Posts: 21
Joined: Wed Sep 28, 2011 3:32 pm

Walang komento:

Mag-post ng isang Komento