Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Hide();
            Management form = new Management();

            form.Show();
        }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();
            if (!Directory.Exists(Const.IO.PathPictures))
            {
                Directory.CreateDirectory(Const.IO.PathPictures);
            }

            if (!Directory.Exists(Const.IO.PathGifs))
            {
                Directory.CreateDirectory(Const.IO.PathGifs);
            }

            if (!Directory.Exists(Const.IO.PathVids))
            {
                Directory.CreateDirectory(Const.IO.PathVids);
            }


            this.timer1.Interval = 1000;
            Management man = new Management(this);

            man.Show();
            //ShowGif("C:\\Users\\Alexandre\\Desktop\\Gifs\\Ours");
        }
Beispiel #3
0
        private void Ok_Click(object sender, EventArgs e)
        {
            string username     = UserNameTxt.Text;
            string userpassword = UserPasswordTxt.Text;

            if (username == "" || userpassword == "")
            {
                if (username != "")
                {
                    MessageBox.Show("用户名不能为空!");
                }
                else if (userpassword != "")
                {
                    MessageBox.Show("密码不能为空!");
                }
                else
                {
                    MessageBox.Show("用户名和密码不能为空!");
                }
            }
            else
            {
                SqlConnection con = new SqlConnection("server=TCR-PC\\SQLEXPRESS;database=Hotel Management;uid=sa;pwd=tcr1994");
                con.Open();
                string     sql = "select count(*) from TBL_WORKER where UserName='******' and UserPassword='******'";
                SqlCommand com = new SqlCommand(sql, con);
                int        num = (int)com.ExecuteScalar();
                if (num == 1)
                {
                    SqlCommand com1 = new SqlCommand("select Status from TBL_WORKER where UserName='******'", con);
                    int        i    = (int)com1.ExecuteScalar();
                    if (i == 0)
                    {
                        Hide();
                        MessageBox.Show("管理员登陆成功!");
                        Management form = new Management();
                        form.Show();
                    }
                    if (i == 1)
                    {
                        Hide();
                        MessageBox.Show("前台登陆成功!");
                        Main form = new Main();
                        form.Show();
                    }
                }
                else
                {
                    MessageBox.Show("用户名或密码错误!");
                }
            }
        }
Beispiel #4
0
        public Form1()
        {
            InitializeComponent();
            if (!Directory.Exists(Const.IO.PathPictures))
                Directory.CreateDirectory(Const.IO.PathPictures);

            if (!Directory.Exists(Const.IO.PathGifs))
                Directory.CreateDirectory(Const.IO.PathGifs);

            if (!Directory.Exists(Const.IO.PathVids))
                Directory.CreateDirectory(Const.IO.PathVids);


            this.timer1.Interval = 1000;
            Management man = new Management(this);
            man.Show();
            //ShowGif("C:\\Users\\Alexandre\\Desktop\\Gifs\\Ours");
        }