private void btnDelete_Click(object sender, EventArgs e) { cl_logIn lg = new cl_logIn(); PUBLIC_VARS.EDITMODE = true; if (listView1.SelectedItems.Count != 0) { int uD = Convert.ToInt32(listView1.SelectedItems[0].Text); lg.DeleteUser(uD); lg.loaduserToListview(listView1, 0); txtusername.Text = ""; txtPassword.Text = ""; cboType.Text = ""; } else { MessageBox.Show("Please select user to be deleted."); return; } }
private void frmUserEntry_Load(object sender, EventArgs e) { cl_logIn lg = new cl_logIn(); txtusername.ReadOnly = true; txtPassword.ReadOnly = true; cboType.Enabled = false; lg.loaduserToListview(listView1, 0); }
private void btnSave_Click(object sender, EventArgs e) { cl_logIn lg = new cl_logIn(); //txtusername.Text = lg.username; //txtPassword.Text = lg.password; //cboType.Text = lg.utype; if(PUBLIC_VARS.EDITMODE == true){ int uD = Convert.ToInt32(listView1.SelectedItems[0].Text); lg.UpdateUser(txtusername.Text, txtPassword.Text, cboType.Text, uD); MessageBox.Show(PUBLIC_VARS.updateData); } else{ lg.InsertUserId(txtusername.Text, txtPassword.Text, cboType.Text); MessageBox.Show(PUBLIC_VARS.saveData); } txtusername.Text = ""; txtPassword.Text = ""; cboType.Text = ""; lg.loaduserToListview(listView1, 0); }