/// <summary>
        /// Get the permission for a specific UserID on a specific TaskID ON A SPECIFIC UserOrganizationID
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="taskID"></param>
        /// <param name="userOrganizationID"></param>
        /// <returns></returns>
        public static bool GetUserEditable(int userID, GlobalEnum.TaskID taskID, int userOrganizationID)
        {
            //Need to check the lasted version
            //Set lRec = ADORECNEW(): Call lRec.Open("SELECT MAX(VersionID) AS VersionID FROM VersionMaster ", ClassConn)
            //If Not lRec.BOF And Not lRec.EOF Then
            //    If lNMVNVersionID <> lRec.Fields("VersionID") Then
            //        MsgBox "The program ERmgr on this computer is not the lasted version." & Chr(13) & "Please contact your admin for more information. Thank you!", vbExclamation + vbDefaultButton1, "ERmgr"
            //        End
            //    End If
            //End If

            SqlParameter[] sqlParameter = new SqlParameter[3];
            sqlParameter[0] = new SqlParameter("UserID", userID); sqlParameter[0].SqlDbType = SqlDbType.Int; sqlParameter[0].Direction = ParameterDirection.Input;
            sqlParameter[1] = new SqlParameter("TaskID", (int)taskID); sqlParameter[1].SqlDbType = SqlDbType.Int; sqlParameter[1].Direction = ParameterDirection.Input;
            sqlParameter[2] = new SqlParameter("UserOrganizationID", userOrganizationID); sqlParameter[0].SqlDbType = SqlDbType.Int; sqlParameter[0].Direction = ParameterDirection.Input;

            int aclEditable = SQLDatabase.GetScalarValue("SPUserACLEditable", CommandType.StoredProcedure, sqlParameter);

            return((ACLLevel)aclEditable == ACLLevel.ACLEditable);
        }
Exemple #2
0
 public static int GetScalarValue(string queryString)
 {
     return(SQLDatabase.GetScalarValue(queryString, CommandType.Text, null));
 }