private void button6_Click(object sender, EventArgs e) { textBox1.ReadOnly = false; Sqlqueries a = new Sqlqueries(); a.displayEmp(listView1); }
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; }
private void button1_Click(object sender, EventArgs e) { try { if (textBox1.Text != String.Empty) { Sqlqueries a = new Sqlqueries(); a.InsertShip(int.Parse(textBox1.Text), comboBox1.Text, comboBox2.Text, comboBox4.Text, textBox3.Text, richTextBox1.Text, comboBox5.Text, textBox4.Text); a.displayShip(listView1); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button3_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0 && textBox1.Text != String.Empty) { Sqlqueries a = new Sqlqueries(); a.updateShip(int.Parse(textBox1.Text), comboBox1.Text, comboBox2.Text, comboBox4.Text, textBox3.Text, richTextBox1.Text, comboBox5.Text, textBox4.Text); a.displayShip(listView1); Docks_Load(sender, e); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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); } }
private void button4_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { string name = listView1.SelectedItems[0].Text; Sqlqueries a = new Sqlqueries(); a.deleteEmp(name); button7_Click(sender, e); } else { MessageBox.Show("Select an Entry from List to Delete", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button6_Click(object sender, EventArgs e) { try { textBox1.ReadOnly = false; Sqlqueries a = new Sqlqueries(); a.displayShip(listView1); textBox1.Clear(); textBox3.Clear(); textBox4.Clear(); comboBox1.Text = ""; comboBox2.Text = ""; comboBox4.SelectedIndex = 0; comboBox5.Text = ""; richTextBox1.Clear(); Docks_Load(sender, e); } catch (Exception ex) { MessageBox.Show("Please Put Some Text Box"); } }
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); } }
private void Docks_Load(object sender, EventArgs e) { comboBox4.SelectedIndex = 0; Sqlqueries a = new Sqlqueries(); a.displayShip(listView1); a.comboGoods(comboBox2); toolStripStatusLabel4.Text = "Date : " + DateTime.Now.ToLongDateString(); // Status Strip Counts totship = 0; availship = 0; needrepairship = 0; notavailship = 0; for (int i = 0; i < listView1.Items.Count; i++) { totship++; if (listView1.Items[i].SubItems[3].Text == "Available") { availship++; } else if (listView1.Items[i].SubItems[3].Text == "Need Repairing") { needrepairship++; } else if (listView1.Items[i].SubItems[3].Text == "Not Available") { notavailship++; } } toolStripStatusLabel1.Text = "Total : " + totship; toolStripStatusLabel2.Text = "Available : " + availship; toolStripStatusLabel3.Text = "Need Repairing : " + needrepairship; toolStripStatusLabel5.Text = "Not Available : " + notavailship; }
private void button5_Click(object sender, EventArgs e) { try { DialogResult dr = MessageBox.Show("Are you sure you want to delete?", "Confirmation", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { if (listView1.SelectedItems.Count > 0) { Sqlqueries a = new Sqlqueries(); a.deleteShip(int.Parse(listView1.SelectedItems[0].Text)); a.displayShip(listView1); } else { MessageBox.Show("Select a field to Delete", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }