public bool ChangeLastOnline(string customerId, DateTime time) { string query = "CHAT.CUSTOMER_LASTONLINE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, customerId, time); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool UnFriend(string customerId, string requestId) { string query = "CHAT.FRIEND_DELETE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, customerId, requestId); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool AddMessage(MessageInfo msg) { string query = "CHAT.MESSAGE_CREATE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, msg.Id, msg.SenderId, msg.ReceiverId, msg.Content, msg.Datetime, msg.MessageType); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool DeleteFriendRequest(string requestId) { string query = "CHAT.FRIENDREQUEST_DELETE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, requestId); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool UpdateCustomerInfo(CustomerInfo cus) { string query = "CHAT.CUSTOMER_UPDATE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, cus.CustomerId, cus.CustomerName); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool AddFriendRequest(AddFriendRequest request) { string query = "CHAT.FRIENDREQUEST_CREATE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, request.Id, request.Sender, request.Receiver, request.Datetime); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool LeaveGroup(string customerId, string groupId) { string query = "CHAT.LEAVEGROUP"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, customerId, groupId); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool DeleteGroupInfo(string groupId) { string query = "CHAT.GROUP_DISABLE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, groupId); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool UpdateGroupInfo(GroupInfo group) { string query = "CHAT.GROUP_UPDATE"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); helper.ExecuteNonQuery(query, group.GroupId, group.GroupName, group.Description, group.IsPrivate); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }
public bool SetAdminGroup(string customerId, string groupId, bool isAdmin) { string query = "CHAT.SETADMINGROUP"; try { OracleDataHelper helper = OracleHelper; helper.BeginTransaction(); int admin = 0; if (isAdmin) { admin = 1; } helper.ExecuteNonQuery(query, customerId, groupId, admin); helper.Commit(); } catch (Exception ex) { OracleHelper.Rollback(); throw ex; } return(true); }