public int GetCompanyNumber(int ID)
        {
            string StoredProcedureName             = StoredProcedures.GetCompanyPhone;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();

            Parameters.Add("@CompanyID", ID);
            return((int)dbMan.ExecuteScalar(StoredProcedureName, Parameters));
        }
Esempio n. 2
0
        public int UserSignIn(string userName, string password)
        {
            string StoredProcedureName             = StoredProcedures.UserSignInAuth;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();

            Parameters.Add("@UserName", userName);
            Parameters.Add("@Password", password);
            return(int.Parse(dbMan.ExecuteScalar(StoredProcedureName, Parameters).ToString()));
        }
Esempio n. 3
0
        //checks the username/password and returns the priviledges associated with this user
        //Returns 0 in case of error
        public int CheckPassword_Basic(string username, string password)
        {

            //Query the DB to check for username/password
            string query = "SELECT Privelege from Login where User_Name = '" + username + "' and Password='******';";
            object p = dbMan.ExecuteScalar(query);
            if (p == null) return 0;
            else return Convert.ToInt32(p);
        }
Esempio n. 4
0
//checks the username/password and returns the priviledges associated with this user
        //Returns 0 in case of error
        public int getidfromuserandpriv(string username, int priv)
        {
            if (priv == 2)
            {
                string query = "Select [Teacher-ID] from teacher where teacher.username='******';";
                return((int)dbMan.ExecuteScalar(query));
            }
            else if (priv == 3)
            {
                string query = "Select [Student-ID] from student where student.username='******';";
                return((int)dbMan.ExecuteScalar(query));
            }
            return(0);
        }
Esempio n. 5
0
        //checks the username/password and returns the priviledges associated with this user
        //Returns 0 in case of error
        public int CheckPassword_Basic(string username, string password)
        {
            //Query the DB to check for username/password
            string query = StoredProcedures.Login;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();

            Parameters.Add("@username", username);
            Parameters.Add("@password", password);
            object p = dbMan.ExecuteScalar(query, Parameters);

            if (p == null)
            {
                return(0);
            }
            else
            {
                return((int)p);
            }
        }
        //checks the username/password and returns the priviledges associated with this user
        //Returns 0 in case of error
        public int CheckPassword_Basic(string username, string password)
        {
            string q    = "SELECT Priv FROM USERS_BASIC WHERE username = '******' AND password = '******';";
            object priv = dbMan.ExecuteScalar(q);

            if (priv == null)
            {
                return(0);
            }
            else
            {
                return((int)priv);
            }
        }
Esempio n. 7
0
        public int GetCUID(string Cuser)
        {
            string StoredProcedureName             = StoredProcedures.GetIDByName;
            Dictionary <string, object> Parameters = new Dictionary <string, object>();

            Parameters.Add("@CName", Cuser);

            return((int)dbMan.ExecuteScalar(StoredProcedureName, Parameters));
        }
Esempio n. 8
0
        /*-----------------------Login Form-----------------------*/

        // Checks the patient username/password and returns the patient id
        // Returns -1 in patient is not found
        public int PatientPasswordCheck(string username, string password)
        {
            string query = "SELECT PID FROM Patient where Username = '******' and Password = '******';";
            object p     = dbMan.ExecuteScalar(query);

            if (p == null)
            {
                return(-1);
            }
            else
            {
                return((int)((long)p));
            }
        }
Esempio n. 9
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Admin Login

        public string AdminLogin(int ID)
        {
            string query = "SELECT job FROM Admins WHERE ID = '" + ID + "';";

            return((string)dbMan.ExecuteScalar(query));
        }