/// <summary> /// 删除离线消息 /// </summary> /// <param name="aHostEmail">接受者邮箱</param> /// <param name="aFriendEmail">发送者邮箱</param> /// <returns></returns> public void DeleteOffMessage(string aHostEmail, string aFriendEmail) { SqlStoreCommand mSqlStoreCommand = new SqlStoreCommand(); mSqlStoreCommand.StoreProdureName = "Chat_Message"; mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("@mFunctionName", "DeleteOffMessage"); mSqlStoreCommand.AddParameters("@mReceiverEmail", aHostEmail); mSqlStoreCommand.AddParameters("@mSenderEmail", aFriendEmail); mSqlStoreCommand.ExecuteNonQuery(); }
/// <summary> /// 同意添加好友 /// </summary> public int AgreeAddFriend(string aUserEmail,string aFriendEmail) { SqlStoreCommand mSqlStoreCommand = new SqlStoreCommand(); mSqlStoreCommand.StoreProdureName = "Chat_Friend"; mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("@mFunctionName","AdmmitOrNot1"); mSqlStoreCommand.AddParameters("@mHostEmail", aUserEmail); mSqlStoreCommand.AddParameters("@mFriendEmail",aFriendEmail); mSqlStoreCommand.ExecuteNonQuery(); return 1; }
/// <summary> /// 添加好友 /// </summary> /// <param name="userEmail">好友邮箱</param> public int AddFriends(string aUserEmail,string aFriendEmail) { SqlStoreCommand mSqlStoreCommand = new SqlStoreCommand(); mSqlStoreCommand.StoreProdureName = "Chat_Friend"; mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("@mFunctionName", "InsertIntoFr"); mSqlStoreCommand.AddParameters("@mHostEmail",aUserEmail); mSqlStoreCommand.AddParameters("@mFriendEmail",aFriendEmail); int mAddFriends = mSqlStoreCommand.ExecuteNonQuery(); return mAddFriends; }
/// <summary> /// 修改密码 /// </summary> /// <param name="aUserEmail">用户邮箱</param> /// <param name="aUserPassword">原密码</param> /// <param name="aUserNewPassword">所要修改的密码</param> /// <returns></returns> public int UpdatePassword(string aUserEmail,string aUserPassword,string aUserNewPassword) { SqlStoreCommand mSqlStoreCommand = new SqlStoreCommand(); mSqlStoreCommand.StoreProdureName = "Chat_User"; mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("mFunctionName", "GetPassword"); mSqlStoreCommand.AddParameters("@mUserEmail", aUserEmail); if (Encryption.EncryptString(aUserPassword, "jingyetankey").Equals(Convert.ToString(mSqlStoreCommand.ExecuteFunction()))) { mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("mFunctionName", "UpdatePassword"); mSqlStoreCommand.AddParameters("@mUserEmail", aUserEmail); mSqlStoreCommand.AddParameters("@mNuserPassword", Encryption.EncryptString(aUserNewPassword, "jingyetankey")); } int mUpdatePassword = mSqlStoreCommand.ExecuteNonQuery(); return mUpdatePassword; }
/// <summary> /// 插入离线消息 /// </summary> /// <param name="mMessage"></param> /// <returns></returns> public void OffMessage(string aHostEmail, string aFriendEmail, string aMessage) { SqlStoreCommand mSqlStoreCommand = new SqlStoreCommand(); mSqlStoreCommand.StoreProdureName = "Chat_Message"; mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("@mFunctionName", "InsertInToOff"); mSqlStoreCommand.AddParameters("@mSenderEmail", aHostEmail); mSqlStoreCommand.AddParameters("@mReceiverEmail", aFriendEmail); mSqlStoreCommand.AddParameters("@mMessage", aMessage); mSqlStoreCommand.AddParameters("@mTime", System.DateTime.Now); mSqlStoreCommand.ExecuteNonQuery(); }
/// <summary> /// 修改个人信息 /// </summary> /// <param name="aUserEmail">用户邮箱</param> /// <param name="aUserName">用户昵称</param> /// <param name="aRemark">备注</param> public int UpdateSelfMessage(string aUserEmail,string aUserName,string aRemark) { SqlStoreCommand mSqlStoreCommand = new SqlStoreCommand(); mSqlStoreCommand.StoreProdureName = "Chat_User"; mSqlStoreCommand.ClearParameters(); mSqlStoreCommand.AddParameters("mFunctionName", "Update"); mSqlStoreCommand.AddParameters("@mUserEmail",aUserEmail); mSqlStoreCommand.AddParameters("@mUserName",aUserName); mSqlStoreCommand.AddParameters("@mRemark", aRemark); mSqlStoreCommand.AddParameters("@mModifyTime",System.DateTime.Now); int mUpdateSelfMessage=mSqlStoreCommand.ExecuteNonQuery(); return mUpdateSelfMessage; }