示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
        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);
        }
示例#9
0
        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);
        }
示例#10
0
        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);
        }