private void btnlogin_Click(object sender, EventArgs e) { if (txtname.Text == "") { MessageBox.Show("Enter Login Name !", "Medical System"); } else if (txtpass.Text == "") { MessageBox.Show("Enter Login Password !", "Medical System"); } else { UDT = UAdapter.SelectForLOGIN(txtname.Text, txtpass.Text); if (UDT.Rows.Count > 0) { lblname.Text = "welcome " + txtname.Text; username = txtname.Text; txtname.Text = ""; txtpass.Text = ""; gplogin.Visible = false; menulogout.Visible = true; mENUToolStripMenuItem.Enabled = true; sELLToolStripMenuItem.Enabled = true; cLIENTSToolStripMenuItem.Enabled = true; rEPORTSToolStripMenuItem.Enabled = true; mANAGEUSERToolStripMenuItem.Enabled = true; cOMPANYToolStripMenuItem.Enabled = true; } else { MessageBox.Show("Invalid LoginName OR Password !", "Medical System"); } } }
private void button2_Click(object sender, EventArgs e) { int del = UAdapter.Delete(Convert.ToInt32(comboBox1.SelectedValue)); MessageBox.Show("USer Deleted !!", "Medical System"); UDT = UAdapter.SelectUser(); comboBox1.DataSource = UDT; comboBox1.DisplayMember = "U_Name"; comboBox1.ValueMember = "U_ID"; }
private void button2_Click(object sender, EventArgs e) { if (comboBox1.Text == username.ToString()) { MessageBox.Show("You can't delete your profile !!", "Medical System"); } else { int del = UAdapter.Delete(Convert.ToInt32(comboBox1.SelectedValue)); MessageBox.Show("User Deleted Successfuly !!", "Medical System"); UDT = UAdapter.SelectUser(); comboBox1.DataSource = UDT; comboBox1.DisplayMember = "U_Name"; comboBox1.ValueMember = "U_ID"; comboBox1.Text = "SELECT"; } }
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) { } else if (tabControl1.SelectedIndex == 1) { UDT = UAdapter.SelectUser(); comboBox1.DataSource = UDT; comboBox1.DisplayMember = "U_Name"; comboBox1.ValueMember = "U_ID"; } else if (tabControl1.SelectedIndex == 2) { UDT = UAdapter.SelectUser(); dataGridView1.DataSource = UDT; } else if (tabControl1.SelectedIndex == 3) { } }