예제 #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            textBox1.ReadOnly = false;

            Sqlqueries a = new Sqlqueries();

            a.displayEmp(listView1);
        }
예제 #2
0
        private void Employee_Load(object sender, EventArgs e)
        {
            listView1.Columns.Add("Name", 150, HorizontalAlignment.Left);
            listView1.Columns.Add("Contact", 120, HorizontalAlignment.Left);
            listView1.Columns.Add("Work Type", 150, HorizontalAlignment.Left);
            listView1.Columns.Add("Date Of Join", 150, HorizontalAlignment.Left);
            listView1.Columns.Add("Address", 200, HorizontalAlignment.Left);

            Sqlqueries a = new Sqlqueries();

            a.displayEmp(listView1);

            comboBox1.SelectedIndex = 0;
        }
예제 #3
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBox1.Text != "")
         {
             Sqlqueries a = new Sqlqueries();
             a.updateEmp(textBox1.Text, textBox10.Text, textBox9.Text, textBox3.Text, dateTimePicker1.Text, comboBox1.Text, textBox8.Text, richTextBox1.Text, textBox5.Text);
             button7_Click(sender, e);
             a.displayEmp(listView1);
         }
         else
         {
             MessageBox.Show("Select an Entry from List to Update", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text != String.Empty && comboBox1.Text != String.Empty && textBox3.Text != String.Empty && richTextBox1.Text != String.Empty)
                {
                    Sqlqueries a = new Sqlqueries();
                    a.addEmp(textBox1.Text, textBox10.Text, textBox9.Text, textBox3.Text, dateTimePicker1.Text, comboBox1.Text, textBox8.Text, richTextBox1.Text, textBox5.Text);
                    button7_Click(sender, e);
                    a.displayEmp(listView1);
                }

                else
                {
                    MessageBox.Show("Please fill required fields", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }