Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String userno   = textBox1.Text;
            String password = textBox2.Text;

            MTSICS_VO.Login         vo       = new MTSICS_VO.Login();
            IList <MTSICS_VO.Login> userlist = new List <MTSICS_VO.Login>();

            vo.UserNo   = userno;
            vo.PassWord = password;
            vo.Flag     = "1";

            userlist = Login_DAO.CheckOut(userno, password);


            if (userlist.Count == 1)
            {
                vo.BanBie   = userlist[0].BanBie;
                vo.UserName = userlist[0].UserName;
                // vo.Id = userlist[0].Id;
                Login_DAO.UpdateFlag(vo);
                //MessageBox.Show("登录成功");
                this.Visible = false;

                MDIFORM mdiparent = new MDIFORM();
                mdiparent.Show();
            }
            else
            {
                MessageBox.Show("用户名或者密码错误");
            }
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            String userno=textBox1.Text;
            String password=textBox2.Text;
            MTSICS_VO.Login vo = new MTSICS_VO.Login();
            IList<MTSICS_VO.Login> userlist = new List<MTSICS_VO.Login>();
            vo.UserNo = userno;
            vo.PassWord = password;
            vo.Flag = "1";

            userlist= Login_DAO.CheckOut(userno, password);

            if (userlist.Count == 1)
            {
                vo.BanBie = userlist[0].BanBie;
                vo.UserName = userlist[0].UserName;
               // vo.Id = userlist[0].Id;
                Login_DAO.UpdateFlag(vo);
                //MessageBox.Show("登录成功");
                this.Visible = false;

                MDIFORM mdiparent = new MDIFORM();
                mdiparent.Show();
            }
            else
                MessageBox.Show("用户名或者密码错误");
        }
Beispiel #3
0
 public static void UpdateFlag(Login vo)
 {
     using (ISession session = SessionHelper.GetSession())
     {
         session.Update(vo);
         session.Flush();
     }
 }
Beispiel #4
0
        //退出程序
        private void MainFrm_FormClosed(object sender, FormClosedEventArgs e)
        {
            IList<MTSICS_VO.Login> userlist = new List<MTSICS_VO.Login>();
                userlist = Login_DAO.CheckOutByFlag();
                MTSICS_VO.Login vo = new MTSICS_VO.Login();
                foreach (MTSICS_VO.Login t in userlist)
                {
                     vo.UserName= t.UserName;
                     vo.PassWord = t.PassWord;
                     vo.UserNo = t.UserNo;
                     vo.BanBie = t.BanBie;
                     //vo.Id = t.Id;
                     vo.Flag = "0";
                }
                Login_DAO.ResetFlag(vo);

                Application.Exit();
        }