Example #1
0
        public ActionResult Register(AkunUSER akunUSER)
        {
            connectionString();
            conn.Open();
            com.Connection  = conn;
            com.CommandText = "Insert into akun (username,PASSWORD,role) values ('" + akunUSER.username
                              + "','" + akunUSER.password + "',2)";

            dr = com.ExecuteReader();
            if (dr.Read())
            {
                conn.Close();
                return(View("DaftarForm"));
            }
            else
            {
                conn.Close();
                return(View("Login"));
            }
        }
Example #2
0
        public ActionResult Verify(AkunUSER akunUSER)
        {
            connectionString();
            conn.Open();
            com.Connection  = conn;
            com.CommandText = "Select * from akun where username='******' and password='******' and role=2";

            dr = com.ExecuteReader();
            if (dr.Read())
            {
                conn.Close();
                return(View("home"));
            }
            else
            {
                conn.Close();
                return(View("Login"));
            }
        }