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));
        }
示例#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()));
        }
示例#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);
        }
示例#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);
        }
示例#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);
            }
        }
示例#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));
        }
示例#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));
            }
        }
示例#9
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Admin Login

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

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