예제 #1
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     cl_logIn lg = new cl_logIn();
     PUBLIC_VARS.EDITMODE = true;
     int uD = Convert.ToInt32(listView1.SelectedItems[0].Text);
     txtusername.ReadOnly = false;
     txtPassword.ReadOnly = false;
     cboType.Enabled = true;
     lg.loadUSer(uD);
     txtusername.Text = lg.username;
     txtPassword.Text = lg.password;
     cboType.Text = lg.utype;
 }
예제 #2
0
 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;
     }
 }
예제 #3
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);
        }
예제 #4
0
 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);
 }