Example #1
0
 private void simpleButton4_Click(object sender, EventArgs e)
 {
     PL.FRM_LOGIN frm_login = new PL.FRM_LOGIN();
     tb_user                  = dbs.TB_USERS.Where(x => x.USER_STATE == "True").FirstOrDefault();
     tb_user.USER_STATE       = "False";
     dbs.Entry(tb_user).State = System.Data.Entity.EntityState.Modified;
     dbs.SaveChanges();
     this.Enabled = false;
     frm_login.Show();
     this.Hide();
 }
        private void timer1_Tick(object sender, EventArgs e)
        {
            tb_user = dbs.TB_USERS.Where(x => x.USER_STATE == "True").FirstOrDefault();
            if (tb_user != null)
            {
                frm_main.lb_user.Text = tb_user.USER_NAME;
                frm_main.lb_roll.Text = tb_user.USER_ROLL;
                frm_main.Show();
            }
            else
            {
                frm_login.Show();
            }

            this.Hide();
            timer1.Enabled = false;
        }