private void gunaAdvenceButton1_Click(object sender, EventArgs e) { var user = new userClass(); db = new PreSchoolEntities1(); var authUser = db.tbl_user.Where( x => x.username == username.Text && x.password == gunaLineTextBox2.Text ).FirstOrDefault(); if (authUser != null) { userClass.setUserId(int.Parse(authUser.id.ToString())); userClass.setUserName(authUser.username); userClass.setFullName(authUser.User_fullname); userClass.setUserStatus(authUser.status.ToString()); userClass.setUserRole(authUser.User_Role); userClass.setUserPassword(authUser.password); main main = new main(); main.c = gunaWinSwitch1.Checked; main.Show(); this.Hide(); } else { MessageBox.Show(this, "Wrong Credentials"); } }
private void main_Load(object sender, EventArgs e) { var user = new userClass(); gunaLabel1.Text = "Welcome " + userClass.getFullName(); if (c) { chanagecolor(); isc = true; } if (isc) { gunaWinSwitch1.Checked = true; } }