Example #1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (i == 0)
     {
         timer1.Enabled = false;
         timer1.Stop();
         login sf = new login();
         sf.Show();
         this.Hide();
     }
     else
     {
         i = i - 1;
     }
     lblCountDwn.Text = "Countdown ..... " + i.ToString();
 }
Example #2
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            string id      = tb_id.Text.ToString();
            string pw      = tb_pw.Text.ToString();
            string pw2     = tb_pw2.Text.ToString();
            string name    = tb_name.Text.ToString();
            string age     = tb_age.Text.ToString();
            string address = comboBox1.Text.ToString();
            string sex     = tb_sex.Text.ToString();

            if (id == string.Empty || pw == string.Empty || pw2 == string.Empty)
            {
                MessageBox.Show("빈칸 없이 입력해주세요.");
                return;
            }

            //pw pw 2 확인
            if (pw != pw2)
            {
                MessageBox.Show("PW와 PW확인이 다름니다.");
                return;
            }
            // id 중복체크 확인
            if (idcheck == false)
            {
                MessageBox.Show("ID 중복체크를 해주세요.");
                return;
            }

            bool result = DBM.AddMember(id, pw, name, age, sex, address);

            if (result == false)
            {
                MessageBox.Show("가입에 실패하였습니다.\n 관리자게에 문의하세요.");
                return;
            }



            // 로그인폼 이동
            Hide();
            login loginfrom = new login();

            loginfrom.ShowDialog();
            Close();
        }
Example #3
0
        private void logoutButton_Click(object sender, EventArgs e)
        {
            if (loggedIn == true)
            {
                //open login form
                login check = new login();
                check.ShowDialog();

                if (check.loginflag == false)
                {
                    MessageBox.Show("Login Failed!");
                }
                else
                {
                    loggedIn = true;
                }
            }
        }
Example #4
0
        public Form1()
        {
            InitializeComponent();

            lg           = new login();
            lg.dangnhap += button24_Click;


            tabthongke.Visible = false;
            pndangnhapuser.Controls.Add(lg);

            //add usercontrols
            tabquanlinhapkho.Controls.Add(tp);
            tabquanlinhapkho.Controls.Add(dspn);
            tabquanlinhapkho.Controls.Add(nccv);

            tabquanlixuatkho.Controls.Add(xk);

            tabdanhsachsp.Controls.Add(lv);
            tabdanhsachsp.Controls.Add(tsp);
            tabdanhsachsp.Controls.Add(dssp);

            tabdanhsachnv.Controls.Add(nv);

            tabquanlinhapkho.Controls.Add(dstk);
            tabquanlixuatkho.Controls.Add(tkxk);

            pnthongke.Controls.Add(cv);

            tp.Dock   = DockStyle.Fill;
            lv.Dock   = DockStyle.Fill;
            dssp.Dock = DockStyle.Fill;
            tsp.Dock  = DockStyle.Fill;
            dspn.Dock = DockStyle.Fill;
            xk.Dock   = DockStyle.Fill;
            nv.Dock   = DockStyle.Fill;
            nccv.Dock = DockStyle.Fill;
            dstk.Dock = DockStyle.Fill;
            tkxk.Dock = DockStyle.Fill;
            cv.Dock   = DockStyle.Fill;
        }
Example #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string[] lines = File.ReadAllLines(@"C:\Users\MAHE\documents\visual studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\user.txt");

            for (int i = 0; i < lines.Length; i++)
            {
                line = lines[i];
                if (line.Equals(login_name))
                {
                    i = lines.Length;

                    if (flag == 1)
                    {
                        flag = 0; f = 1;
                        MessageBox.Show("Authenticated for player 1, now login/signup for player 2.");
                        var home = new home();
                        home.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Authenticated for both players, now let the games begin");
                        var khelshuru = new khelshuru();
                        f = 0;
                        khelshuru.Show();
                        this.Hide();
                    }
                }
            }
            if (f == 1 && flag != 0)
            {
                MessageBox.Show("Not Authenticated,try again");
                var login = new login();
                login.Show();
                this.Hide();
            }
        }
Example #6
0
        private void Tool_Stuffbusic_Click(object sender, EventArgs e)
        {
            login         login_username = new login();
            SqlConnection mysql          = new SqlConnection(contsql);

            mysql.Open();
            SqlCommand    mycmd = new SqlCommand("SELECT * FROM position ", mysql);
            SqlDataReader sqldr = mycmd.ExecuteReader();

            while (sqldr.Read())
            {
                if (temp.e_num == sqldr["e_number"].ToString())
                {
                    string M_str_sql_position = sqldr["e_position"].ToString();
                    if (M_str_sql_position == "经理")
                    {
                        ManFile child = new ManFile();
                        child.TopLevel        = false;
                        child.Dock            = System.Windows.Forms.DockStyle.Fill;
                        child.FormBorderStyle = FormBorderStyle.None;
                        child.Parent          = this.panel;
                        this.panel.Controls.Add(child);
                        child.Show();
                    }
                    else if (M_str_sql_position == "员工")
                    {
                        WindowsFormsApplication1.Folder1.userabc child = new WindowsFormsApplication1.Folder1.userabc();
                        child.TopLevel        = false;
                        child.Dock            = System.Windows.Forms.DockStyle.Fill;
                        child.FormBorderStyle = FormBorderStyle.None;
                        child.Parent          = this.panel;
                        this.panel.Controls.Add(child);
                        child.Show();
                    }
                }
            }
        }
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //START SHOW SIGN IN FORM
     login login = new login();
     login.Show();
     //END SHOW SIGN IN FORM
     this.Close();
 }
Example #8
0
        private void button2_Click(object sender, EventArgs e)
        {
            login sf = new login();
            this.Hide();

            sf.Show();
        }
Example #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form frm2 = new login();

            frm2.Show();
        }
Example #10
0
        private void bckbtmfrmqa_Click(object sender, EventArgs e)
        {
            login frm = new login();

            frm.Show();
        }
Example #11
0
 private void salirToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var form = new login();
     form.Show();
     Hide();
 }
        private void signup_Click(object sender, EventArgs e)
        {
            string        connetionString;
            SqlConnection cnn;

            connetionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\ITECH\Desktop\HRMIS PA\HRMIS\HRMIS\Database1.mdf;Integrated Security=True";
            cnn             = new SqlConnection(connetionString);
            cnn.Open();
            if (txtadd.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtname.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            else if (txtpword.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtuname.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtcpword.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtposition.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtID.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                SqlCommand     cmd = new SqlCommand("Select * from tblAccount where uname = '" + txtuname.Text + "'", cnn);
                SqlDataAdapter da  = new SqlDataAdapter(cmd);
                DataSet        ds  = new DataSet();
                DataTable      dt  = new DataTable();
                da.Fill(ds);

                int i = ds.Tables[0].Rows.Count;
                if (i > 0)
                {
                    MessageBox.Show("Username:"******" is already exist.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (txtcpword.Text == txtpword.Text)
                    {
                        try
                        {
                            string     sql    = "INSERT INTO tblAccount (name,address,position,uname,pword,confirmpword,Id_no) values ('" + txtname.Text + "','" + txtadd.Text + "','" + txtposition.Text + "','" + txtuname.Text + "','" + txtpword.Text + "','" + txtcpword.Text + "','" + txtID.Text + "')";
                            SqlCommand exesql = new SqlCommand(sql, cnn);
                            exesql.ExecuteNonQuery();
                            MessageBox.Show("Account Registered", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            cnn.Close();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        this.Hide();
                        login f2 = new login();
                        f2.Show();
                    }

                    else
                    {
                        MessageBox.Show("Password not Match", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }