示例#1
0
        //backto dashboard

        private void label6_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            User_DashBoard ud = new User_DashBoard();

            ud.Show();
        }
示例#2
0
文件: DBIE.cs 项目: ksinha49/DTool
        private void label3_Click(object sender, EventArgs e)
        {
            this.Hide();
            User_DashBoard er = new User_DashBoard();

            er.Show();
        }
示例#3
0
        private void button3_Click(object sender, EventArgs e)
        {
            con = new System.Data.SqlServerCe.SqlCeConnection();
            con.ConnectionString = "DataSource=|DataDirectory|cidb13.sdf";
            SqlCeCommand cmd2 = con.CreateCommand();

            cmd2.CommandText = "SELECT * From Employee_reg ";
            int flag = 0, f1 = 0;

            con.Open();
            cmd2.ExecuteNonQuery();
            SqlCeDataReader readData = cmd2.ExecuteReader();

            if (readData != null)
            {
                while (readData.Read())
                {
                    if (readData.GetString(8) == "Reviewed")
                    {
                        if (readData.GetString(2) == textBox2.Text && (readData.GetString(1) == textBox1.Text))
                        {
                            /* if (textBox1.Text == "Admin")
                             * {
                             *   string u1 = readData.GetString(0);
                             *   this.Hide();
                             *   adminPanel ad = new adminPanel();
                             *   LoginInfo.UserID = u1;
                             *   ad.Show();
                             *   flag=1;
                             *
                             * }
                             * else*/

                            string u = readData.GetString(0);
                            this.Hide();
                            User_DashBoard er = new User_DashBoard();
                            LoginInfo.UserID = u;
                            er.Show();
                            flag = 1;
                        }
                    }
                    else if (readData.GetString(8).Equals("Not Reviewed"))
                    {
                        if (readData.GetString(2) == textBox2.Text && (readData.GetString(1) == textBox1.Text))
                        {
                            f1   = 1;
                            flag = 1;
                        }
                    }
                }
            }

            if (flag == 0)
            {
                MessageBox.Show("Wrong password or username.Try again ");
            }

            else if (f1 == 1)
            {
                MessageBox.Show("Login Verfication in process.\nCan't access.\nContact Admin for Login Details");
            }
            //ds1 = new DataSet();
            //string sql = "SELECT * From Employee_reg where UserName='******'";
            //da = new System.Data.SqlServerCe.SqlCeDataAdapter(sql, con);
            //da.Fill(ds1, "Employee_reg");
            //DataRow drow = ds1.Tables["Employee_reg"].Rows[0];

            /*foreach (DataRow drow in ds1.Employee_reg)
             * {
             *  if (drow.ItemArray[0].Equals(textBox1.Text) && drow.ItemArray[1].Equals(textBox2.Text))
             *  {
             *      this.Hide();
             *      User_DashBoard er = new User_DashBoard();
             *      er.str1 = drow.ItemArray.GetValue(1).ToString();
             *      er.Show();
             *  }
             *  else
             *  {
             *      MessageBox.Show("Wrong password or username.Try again ");
             *  }
             * }*/

            con.Close();
        }