コード例 #1
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public void removeFriend(string user_id, string friend_id)
    {
        storedProcedure myProc = new storedProcedure("removeFriend");
        myProc.addParam(new paramter("@user_id", user_id));
        myProc.addParam(new paramter("@friend_id", friend_id));

        myProc.executeNonQueryParam();
    }
コード例 #2
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public void removeFriend(string user_id, string friend_id)
    {
        storedProcedure myProc = new storedProcedure("removeFriend");

        myProc.addParam(new paramter("@user_id", user_id));
        myProc.addParam(new paramter("@friend_id", friend_id));

        myProc.executeNonQueryParam();
    }
コード例 #3
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public DataTable checkIfFriend(string user_id, string friend_id)
    {
        storedProcedure myProc = new storedProcedure("checkIfFriend");
        myProc.addParam(new paramter("@user_id", user_id));
        myProc.addParam(new paramter("@friend_id", friend_id));
        DataTable table = new DataTable();

        return table = myProc.executeReader();
    }
コード例 #4
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public DataTable mutualFriends(string user_id, string visitedUser_Id)
    {
        storedProcedure myProc = new storedProcedure("mutualFriends");
        myProc.addParam(new paramter("@user_id", user_id));
        myProc.addParam(new paramter("@visitedUser_Id", visitedUser_Id));
        DataTable table = new DataTable();

        return table = myProc.executeReader();
    }
コード例 #5
0
ファイル: MessageDb.cs プロジェクト: howleg/up
    public DataTable getConversation(string recieverID, string senderID)
    {
        storedProcedure myProc = new storedProcedure("getConversation");
        myProc.addParam(new paramter("@recieverID", recieverID));
        myProc.addParam(new paramter("@senderID", senderID));
        DataTable table = new DataTable();

        return table = myProc.executeReader();
    }
コード例 #6
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public DataTable checkIfFriend(string user_id, string friend_id)
    {
        storedProcedure myProc = new storedProcedure("checkIfFriend");

        myProc.addParam(new paramter("@user_id", user_id));
        myProc.addParam(new paramter("@friend_id", friend_id));
        DataTable table = new DataTable();

        return(table = myProc.executeReader());
    }
コード例 #7
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public DataTable mutualFriends(string user_id, string visitedUser_Id)
    {
        storedProcedure myProc = new storedProcedure("mutualFriends");

        myProc.addParam(new paramter("@user_id", user_id));
        myProc.addParam(new paramter("@visitedUser_Id", visitedUser_Id));
        DataTable table = new DataTable();

        return(table = myProc.executeReader());
    }
コード例 #8
0
    public DataTable getConversation(string recieverID, string senderID)
    {
        storedProcedure myProc = new storedProcedure("getConversation");

        myProc.addParam(new paramter("@recieverID", recieverID));
        myProc.addParam(new paramter("@senderID", senderID));
        DataTable table = new DataTable();

        return(table = myProc.executeReader());
    }
コード例 #9
0
ファイル: MessageDb.cs プロジェクト: howleg/up
    public bool SendMessage(string senderID, string recieverID, string subject, string body)
    {
        storedProcedure myProc = new storedProcedure("SendMessage");
            myProc.addParam(new paramter("@senderID", senderID));
            myProc.addParam(new paramter("@recieverID", recieverID));
            myProc.addParam(new paramter("@subject", subject));
            myProc.addParam(new paramter("@body", body));

            return myProc.executeNonQueryParam();
    }
コード例 #10
0
    public bool SendMessage(string senderID, string recieverID, string subject, string body)
    {
        storedProcedure myProc = new storedProcedure("SendMessage");

        myProc.addParam(new paramter("@senderID", senderID));
        myProc.addParam(new paramter("@recieverID", recieverID));
        myProc.addParam(new paramter("@subject", subject));
        myProc.addParam(new paramter("@body", body));

        return(myProc.executeNonQueryParam());
    }
コード例 #11
0
ファイル: MessageDb.cs プロジェクト: howleg/up
    public bool MarkMessageRead(int msgId)
    {
        storedProcedure myProc = new storedProcedure("MarkAsRead");
            myProc.addParam(new paramter("@id", msgId.ToString()));

            return myProc.executeNonQueryParam();
    }
コード例 #12
0
ファイル: MessageDb.cs プロジェクト: howleg/up
 public DataTable GetSentMessages(string userID)
 {
     DataTable table = new DataTable();
         storedProcedure myProc = new storedProcedure("GetSentMessages");
         myProc.addParam(new paramter("@userId", userID));
         return table = myProc.executeReader();
 }
コード例 #13
0
ファイル: MessageDb.cs プロジェクト: howleg/up
 public DataTable getAmountOfUnreadMsg(string UserId)
 {
     DataTable table = new DataTable();
     storedProcedure myProc = new storedProcedure("getAmountOfUnreadMsg");
     myProc.addParam(new paramter("@UserId", UserId));
     return table = myProc.executeReader();
 }
コード例 #14
0
    public void search_Click(object sender, EventArgs e)
    {
        //if the user enters anything in the search  box
        if (!(String.IsNullOrEmpty(usernameInSearchBox)))
        {
            //check the entered text to see if it exist in the users table
            storedProcedure myProc = new storedProcedure("checkUserName");
            paramter        param1 = new paramter("@theUsername", usernameInSearchBox);
            myProc.addParam(param1);
            //if that username exist the userID will be returned
            userId = myProc.executeScalarParam();

            //if the userId is not null or empty means the user was found
            if (!(String.IsNullOrEmpty(userId)))
            {
                userFoundLabel.Text    = "user " + usernameInSearchBox + " found";
                userFoundLabel.Visible = true;

                //send this username to the viewProfile page
                string name = usernameInSearchBox;
                Session["name"] = name;
                Response.Redirect("viewProfile.aspx");
            }
            else
            {
                userFoundLabel.Text    = "" + usernameInSearchBox + " is not a valid username";
                userFoundLabel.Visible = true;
            }
        }
        else
        {
            userFoundLabel.Text    = "Enter a username";
            userFoundLabel.Visible = true;
        }
    }//end of search_Click
コード例 #15
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
 public DataTable getFriendsList(string user_id)
 {
     storedProcedure myProc = new storedProcedure("getFriendsList");
     myProc.addParam(new paramter("@user_id", user_id));
     DataTable table = new DataTable();
     return table = myProc.executeReader();
 }
コード例 #16
0
    private void configStudent()
    {
        storedProcedure myProc1            = new storedProcedure("getMajorName");
        paramter        getMajorNameParam1 = new paramter("@student_id", this.student_id);

        myProc1.addParam(getMajorNameParam1);
        this.major = myProc1.executeScalarParam();


        storedProcedure myProc2             = new storedProcedure("getProfilePic");
        paramter        getProfilePicParam1 = new paramter("@UserId", this.student_id);

        myProc2.addParam(getProfilePicParam1);
        this.profilePic = myProc2.executeScalarParam();


        storedProcedure myProc3             = new storedProcedure("getActualName");
        paramter        getActualNameParam1 = new paramter("@student_id", this.student_id);

        myProc3.addParam(getActualNameParam1);
        this.actualName = myProc3.executeScalarParam();

        storedProcedure myProc4          = new storedProcedure("getAboutMe");
        paramter        getAboutMeParam1 = new paramter("@student_id", this.student_id);

        myProc4.addParam(getAboutMeParam1);
        this.aboutMe = myProc4.executeScalarParam();
    }
コード例 #17
0
    public DataTable GetSentMessages(string userID)
    {
        DataTable       table  = new DataTable();
        storedProcedure myProc = new storedProcedure("GetSentMessages");

        myProc.addParam(new paramter("@userId", userID));
        return(table = myProc.executeReader());
    }
コード例 #18
0
    public bool MarkMessageRead(int msgId)
    {
        storedProcedure myProc = new storedProcedure("MarkAsRead");

        myProc.addParam(new paramter("@id", msgId.ToString()));

        return(myProc.executeNonQueryParam());
    }
コード例 #19
0
    public DataTable getAmountOfUnreadMsg(string UserId)
    {
        DataTable       table  = new DataTable();
        storedProcedure myProc = new storedProcedure("getAmountOfUnreadMsg");

        myProc.addParam(new paramter("@UserId", UserId));
        return(table = myProc.executeReader());
    }
コード例 #20
0
ファイル: MessageDb.cs プロジェクト: howleg/up
    public DataTable GetMessageDetails(int messageId)
    {
        DataTable table = new DataTable();
            storedProcedure myProc = new storedProcedure("ReadMessage");
            myProc.addParam(new paramter("@id", messageId.ToString()));

            return table = myProc.executeReader();
    }
コード例 #21
0
ファイル: UserDb.cs プロジェクト: CaSimpson/CourseHunterV2
    public DataTable GetUserDetails(string userId)
    {
        DataTable table = new DataTable();
            storedProcedure myProc = new storedProcedure("GetUserDetails");
            myProc.addParam(new paramter("@userId", userId));

            return table = myProc.executeReader();
    }
コード例 #22
0
ファイル: FriendDB.cs プロジェクト: CaSimpson/CourseHunterV2
    public DataTable getFriendsList(string user_id)
    {
        storedProcedure myProc = new storedProcedure("getFriendsList");

        myProc.addParam(new paramter("@user_id", user_id));
        DataTable table = new DataTable();

        return(table = myProc.executeReader());
    }
コード例 #23
0
    public DataTable GetMessageDetails(int messageId)
    {
        DataTable       table  = new DataTable();
        storedProcedure myProc = new storedProcedure("ReadMessage");

        myProc.addParam(new paramter("@id", messageId.ToString()));

        return(table = myProc.executeReader());
    }
コード例 #24
0
ファイル: student22.cs プロジェクト: howleg/up
    public student22(String currentUserName)
    {
        this.username = currentUserName;

        storedProcedure myProc1 = new storedProcedure("getUserId");
        myProc1.addParam(new paramter("@UserName", currentUserName));
        this.student_id = myProc1.executeScalarParam();

        con = new SqlConnection(myDbConString);

        configStudent();
    }
コード例 #25
0
ファイル: student22.cs プロジェクト: howleg/up
    //this constructor is a little patch so that we can simulate a constructor overiding
    //because we need to make it possible to create a class using two different types of strings so the int 0 is just to make
    //the distinction between the two
    public student22(String UserID, int dontCareNum)
    {
        this.student_id = UserID;

        storedProcedure myProc1 = new storedProcedure("getUserNameFromUserID");
        myProc1.addParam(new paramter("@UserID", UserID));
        this.username = myProc1.executeScalarParam();

        con = new SqlConnection(myDbConString);

        configStudent();
    }
コード例 #26
0
    //this constructor is a little patch so that we can simulate a constructor overiding
    //because we need to make it possible to create a class using two different types of strings so the int 0 is just to make
    //the distinction between the two
    public student22(String UserID, int dontCareNum)
    {
        this.student_id = UserID;

        storedProcedure myProc1 = new storedProcedure("getUserNameFromUserID");

        myProc1.addParam(new paramter("@UserID", UserID));
        this.username = myProc1.executeScalarParam();

        con = new SqlConnection(myDbConString);

        configStudent();
    }
コード例 #27
0
    public student22(String currentUserName)
    {
        this.username = currentUserName;

        storedProcedure myProc1 = new storedProcedure("getUserId");

        myProc1.addParam(new paramter("@UserName", currentUserName));
        this.student_id = myProc1.executeScalarParam();

        con = new SqlConnection(myDbConString);

        configStudent();
    }
コード例 #28
0
    public void setStudentAttributes(String newName, String newSelectedMajor, String newAboutMe)
    {
        if (String.IsNullOrEmpty(newName))
        {
            newName = this.actualName;
        }
        else
        {
            this.actualName = newName;
        }

        if (String.IsNullOrEmpty(newSelectedMajor))
        {
            newSelectedMajor = this.major;
        }
        else
        {
            this.major = newSelectedMajor;
        }

        this.aboutMe = newAboutMe;


        paramter param1 = new paramter("@student_id", this.student_id);
        paramter param2 = new paramter("@actualName", newName);
        paramter param3 = new paramter("@major_name", newSelectedMajor);
        paramter param4 = new paramter("@text", newAboutMe);

        storedProcedure myProc = new storedProcedure("updateStudentInfo");

        myProc.addParam(param1);
        myProc.addParam(param2);
        myProc.addParam(param3);
        myProc.addParam(param4);

        myProc.executeNonQueryParam();
    }
コード例 #29
0
ファイル: searchUsers.aspx.cs プロジェクト: howleg/up
    public void search_Click(object sender, EventArgs e)
    {
        //if the user enters anything in the search  box
        if (!(String.IsNullOrEmpty(usernameInSearchBox)))
        {
            //check the entered text to see if it exist in the users table
            storedProcedure myProc = new storedProcedure("checkUserName");
            paramter param1 = new paramter("@theUsername", usernameInSearchBox);
            myProc.addParam(param1);
            //if that username exist the userID will be returned
            userId = myProc.executeScalarParam();

            //if the userId is not null or empty means the user was found
            if (!(String.IsNullOrEmpty(userId)))
            {
                userFoundLabel.Text = "user " + usernameInSearchBox + " found";
                userFoundLabel.Visible = true;

                //send this username to the viewProfile page
                string name = usernameInSearchBox;
                Session["name"] = name;
                Response.Redirect("viewProfile.aspx");
            }
            else
            {
                userFoundLabel.Text = "" + usernameInSearchBox + " is not a valid username";
                userFoundLabel.Visible = true;
            }

        }
        else
        {
            userFoundLabel.Text = "Enter a username";
            userFoundLabel.Visible = true;

        }
    }
コード例 #30
0
ファイル: student22.cs プロジェクト: howleg/up
    private void configStudent()
    {
        storedProcedure myProc1 = new storedProcedure("getMajorName");
        paramter getMajorNameParam1 = new paramter("@student_id", this.student_id);
        myProc1.addParam(getMajorNameParam1);
        this.major = myProc1.executeScalarParam();

        storedProcedure myProc2 = new storedProcedure("getProfilePic");
        paramter getProfilePicParam1 = new paramter("@UserId", this.student_id);
        myProc2.addParam(getProfilePicParam1);
        this.profilePic = myProc2.executeScalarParam();

        storedProcedure myProc3 = new storedProcedure("getActualName");
        paramter getActualNameParam1 = new paramter("@student_id", this.student_id);
        myProc3.addParam(getActualNameParam1);
        this.actualName = myProc3.executeScalarParam();

        storedProcedure myProc4 = new storedProcedure("getAboutMe");
        paramter getAboutMeParam1 = new paramter("@student_id", this.student_id);
        myProc4.addParam(getAboutMeParam1);
        this.aboutMe = myProc4.executeScalarParam();
    }
コード例 #31
0
ファイル: student22.cs プロジェクト: howleg/up
    public void setStudentAttributes(String newName,String newSelectedMajor,String newAboutMe)
    {
        if (String.IsNullOrEmpty(newName))
            newName = this.actualName;
        else this.actualName = newName;

        if (String.IsNullOrEmpty(newSelectedMajor))
            newSelectedMajor = this.major;
        else this.major = newSelectedMajor;

        this.aboutMe = newAboutMe;

        paramter param1 = new paramter("@student_id", this.student_id);
        paramter param2 = new paramter("@actualName", newName);
        paramter param3 = new paramter("@major_name", newSelectedMajor);
        paramter param4 = new paramter("@text", newAboutMe);

        storedProcedure myProc = new storedProcedure("updateStudentInfo");
        myProc.addParam(param1);
        myProc.addParam(param2);
        myProc.addParam(param3);
        myProc.addParam(param4);

        myProc.executeNonQueryParam();
    }