/// <summary> /// 更新 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Update(AntSdkReceivedUserMsg.Modify model) { var updateStr = $"update C_USER_INFO set departmentId='{model.attr.departmentId}',position='{model.attr.position}',picture='{model.attr.picture}'" + $",SEX='{model.attr.sex}',signature='{model.attr.signature}' where userId='{model.userId}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
public int Update(SDK.AntSdk.AntModels.AntSdkChatMsg.ChatBase model) { string insertStr = "update t_chat_message_groupburn set chatindex='" + model.chatIndex + "',sendtime='" + model.sendTime + "',SENDSUCESSORFAIL='1' where messageid='" + model.messageId + "'"; return(AntSdkSqliteHelper.ExecuteNonQuery(insertStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, model.sendUserId)); }
/// <summary> /// 发送消息入库 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Insert(SDK.AntSdk.AntModels.AntSdkChatMsg.ChatBase model) { if (model.sourceContent != null) { model.sourceContent = model.sourceContent.Replace("'", "''"); } string insertStr = "insert into T_Chat_Message_Group(MTP,CHATINDEX,CONTENT,MESSAGEID,SENDTIME,SENDUSERID,SESSIONID,TARGETID,SENDORRECEIVE,SENDSUCESSORFAIL,uploadordownpath) values ('" + (int)model.MsgType + "','" + model.chatIndex + "','" + model.sourceContent + "','" + model.messageId + "','" + AntSdkDataConverter.ConvertDateTimeToIntLong(DateTime.Now) + "','" + model.sendUserId + "','" + model.sessionId + "','" + model.targetId + "','" + model.SENDORRECEIVE + "','" + model.sendsucessorfail + "','" + model.uploadOrDownPath + "')"; return(AntSdkSqliteHelper.ExecuteNonQuery(insertStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, model.sendUserId)); }
/// <summary> /// 多端数据插入 /// </summary> /// <param name="model"></param> /// <returns></returns> public int InsertSelfData(SDK.AntSdk.AntModels.AntSdkChatMsg.ChatBase model) { if (model.sourceContent != null) { model.sourceContent = model.sourceContent.Replace("'", "''"); } string insertStr = "insert into T_Chat_Message_Group(MTP,CHATINDEX,CONTENT,MESSAGEID,SENDTIME,SENDUSERID,SESSIONID,TARGETID,SENDORRECEIVE,SENDSUCESSORFAIL) values ('" + (int)model.MsgType + "','" + model.chatIndex + "','" + model.sourceContent + "','" + model.messageId + "','" + model.sendTime + "','" + model.sendUserId + "','" + model.sessionId + "','" + model.targetId + "','" + model.SENDORRECEIVE + "','" + 1 + "')"; return(AntSdkSqliteHelper.ExecuteNonQuery(insertStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
public int Update(SDK.AntSdk.AntModels.AntSdkChatMsg.ChatBase model) { if (model.sourceContent != null) { model.sourceContent = model.sourceContent.Replace("'", "''"); } string insertStr = "update T_Chat_Message_Group set chatindex='" + model.chatIndex + "',sendtime='" + model.sendTime + "',SENDSUCESSORFAIL='1' where messageid='" + model.messageId + "'"; return(AntSdkSqliteHelper.ExecuteNonQuery(insertStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, model.sendUserId)); }
public int Update(AntSdkMassMsgCtt model) { if (string.IsNullOrEmpty(model.chatIndex)) { return(0); } string updateStr = $"update T_MassMsg set sendTime='{model.sendTime}',chatIndex='{model.chatIndex}' where messageId='{model.messageId}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdk.AntSdkService.AntSdkCurrentUserInfo.userId)); }
public int Insert(AntSdkMassMsgCtt model) { if (model.content != null) { model.content = model.content.Replace("'", "''"); } string insertStr = $"insert into T_MassMsg(messageId,sendUserId,targetId,companyCode,content,os,sessionId,sendTime,chatIndex) values " + $"('{model.messageId}','{model.sendUserId}','{model.targetId}','{model.companyCode}','{model.content}','{model.os}','{model.sessionId}','{model.sendTime}','{model.chatIndex}')"; return(AntSdkSqliteHelper.ExecuteNonQuery(insertStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdk.AntSdkService.AntSdkCurrentUserInfo.userId)); }
public int UpdateTopIndex(string sessionId, int?topIndex) { string updateStr; if (topIndex.HasValue) { updateStr = @"update T_Session set TOPINDEX=" + topIndex.Value + " where SESSIONID='" + sessionId + "'"; } else { updateStr = @"update T_Session set TOPINDEX=null where SESSIONID='" + sessionId + "'"; } return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 更新数据库语音状态 0未读 1已读 /// </summary> /// <param name="messageid"></param> /// <returns></returns> public int UpdateVoiceState(string messageid) { string updateStr = "update t_chat_message set voiceread='1' where messageid='" + messageid + "'"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{AntSdkService.AntSdkLoginOutput.userId}\{AntSdkService.AntSdkLoginOutput.userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkLoginOutput.companyCode, AntSdkService.AntSdkLoginOutput.userId)); } else { return(0); } }
/// <summary> /// 删除阅后即焚对应的session会话内容 /// </summary> /// <param name="session_id"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <returns></returns> public int DeleteBurnData(string session_id, string companyCode, string userId) { string deleteStr = "delete from t_chat_message_groupburn where sessionid='" + session_id + "'"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, companyCode, userId)); } else { return(0); } }
/// <summary> /// 根据投票或活动ID删除消息 /// </summary> /// <param name="voteOrActivityId">投票或活动ID</param> /// <param name="sessionId"></param> /// <param name="msgType">消息类型码</param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <returns></returns> public int DeleteGroupMsgByVoteOrActivityId(string voteOrActivityId, string sessionId, string msgType, string companyCode, string userId) { string updateStr = "delete from t_chat_message_group where MTP='" + msgType + "' AND SESSIONID='" + sessionId + "' AND SPARE1='" + voteOrActivityId + "' ;"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
/// <summary> /// 接收文件之后更新文件路径 /// </summary> /// <param name="session_id"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <param name="chatIndex"></param> /// <param name="path"></param> /// <returns></returns> public int updateFilePathAndFlag(string session_id, string companyCode, string userId, string chatIndex, string path) { string updateStr = "update t_chat_message_group set uploadordownpath='" + path + "' where sessionid='" + session_id + "' and messageid='" + chatIndex + "'"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
/// <summary> /// 内容更改 /// </summary> /// <param name="messageid"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <param name="content"></param> /// <returns></returns> public int UpdateContent(string messageid, string companyCode, string userId, string content) { string updateStr = "update t_chat_message set content='" + content + "' where messageid='" + messageid + "'"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
/// <summary> /// 消息重发状态更改 /// </summary> /// <param name="messageid"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <returns></returns> public int UpdateReSendMsgState(string messageid, string companyCode, string userId, string chatindex) { string updateStr = "update t_chat_message set sendsucessorfail='1',chatindex='" + chatindex + "' where messageid='" + messageid + "'"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
public int Update(AntSdkTsession model) { if (model.LastMsg != null) { model.LastMsg = model.LastMsg.Replace("'", "''"); } if (model.BurnLastMsg != null) { model.BurnLastMsg = model.BurnLastMsg.Replace("'", "''"); } string topIndex = model.TopIndex.HasValue ? model.TopIndex.Value.ToString() : "null"; string updateStr = $"update T_Session set UNREADCOUNT='{model.UnreadCount}',LASTMSG='{model.LastMsg}',LastMsgTimeStamp='{model.LastMsgTimeStamp}',LastChatIndex='{model.LastChatIndex}', BURNUNREADCOUNT='{model.BurnUnreadCount}',BURNLASTMSG='{model.BurnLastMsg}',BURNLastMsgTimeStamp='{model.BurnLastMsgTimeStamp}',BURNLastChatIndex='{model.BurnLastChatIndex}' ,ISBURNMODE='{model.IsBurnMode}',TopIndex={topIndex} where SESSIONID='{model.SessionId}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 更新阅后即焚阅读时间 /// </summary> /// <param name="session_id"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <param name="chatIndex"></param> /// <returns></returns> public int UpdateAfterReadBurnTime(string session_id, string companyCode, string userId, string chatIndex, string readtime) { string updateStr = "update t_chat_message set readtime='" + readtime + "' where sessionid='" + session_id + "' and messageid='" + chatIndex + "';"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
/// <summary> ///根据MessageID删除点对点对应的消息记录 /// </summary> /// <param name="session_id"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <param name="messageId"></param> public int DeleteByMessageId(string companyCode, string userId, string messageId) { string updateStr = "delete from t_chat_message where messageid='" + messageId + "'"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
public int Insert(AntSdkTsession model) { if (model.LastMsg != null) { model.LastMsg = model.LastMsg.Replace("'", "''"); } if (model.BurnLastMsg != null) { model.BurnLastMsg = model.BurnLastMsg.Replace("'", "''"); } string topIndex = model.TopIndex.HasValue ? model.TopIndex.Value.ToString() : "null"; //string createSessionTable = "(SESSIONID VARCHAR(64),USERID VARCHAR(64),GROUPID VARCHAR(64),UNREADCOUNT INT,LASTMSG VARCHAR(4000), LASTMSGTIME VARCHAR(64),LASTMODIFYTIME DATETIME,primary key(SESSIONID))"; string insertStr = $"INSERT INTO T_Session(SESSIONID,USERID,GROUPID,UNREADCOUNT,LASTMSG,LASTMSGTIMESTAMP,LASTCHATINDEX,BURNUNREADCOUNT,BURNLASTMSG,BURNLASTMSGTIMESTAMP,BURNLASTCHATINDEX,ISBURNMODE,TopIndex) VALUES " + $"('{model.SessionId}','{model.UserId}','{model.GroupId}','{model.UnreadCount}','{model.LastMsg}','{model.LastMsgTimeStamp}','{model.LastChatIndex}','{model.BurnUnreadCount}','{model.BurnLastMsg}','{model.BurnLastMsgTimeStamp}','{model.BurnLastChatIndex}','{model.IsBurnMode}',{topIndex})"; return(AntSdkSqliteHelper.ExecuteNonQuery(insertStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> ///根据MessageID删除点对点对应的消息记录(一条或多条) /// </summary> /// <param name="session_id"></param> /// <param name="companyCode"></param> /// <param name="userId"></param> /// <param name="messageIds">messageId拼接串</param> public int DeleteByMessageIds(string companyCode, string userId, string messageIds) { if (string.IsNullOrEmpty(messageIds)) { return(0); } string updateStr = "delete from t_chat_message_group where messageid in(" + messageIds + ")"; string dbPath = $@"{AntSdkService.SqliteLocalDbPath}{userId}\{userId}.db"; if (File.Exists(dbPath)) { return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, companyCode, userId)); } else { return(0); } }
/// <summary> /// 全部清空 /// </summary> /// <param name="t"></param> /// <returns></returns> public int AllDelete(string t = null) { var deleteStr = "delete from C_Version"; return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 单条更新 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Update(AntSdkContact_Depart model) { var updateStr = GetUpdateSqlStr(model); return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 全部清空 /// </summary> /// <param name="t"></param> /// <returns></returns> public int AllDelete(AntSdkContact_User t = null) { var deleteStr = "delete from C_DEPARTMENT"; return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 删除 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Delete(AntSdkGroupInfo model) { var deleteStr = GetDeleteSqlStr(model); return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 根据群ID删除群 /// </summary> /// <param name="groupId"></param> /// <returns></returns> public int DeleteByParentDepartId(string groupId) { var deleteStr = $"delete from C_GROUP where groupId='{groupId}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 根据部门ID删除成员 /// </summary> /// <param name="departmentId"></param> /// <returns></returns> public int DeleteByDepartmentId(string departmentId) { var deleteStr = $"delete from C_USER_INFO where departmentId='{departmentId}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
public int Delete(AntSdkTsession model) { string deleteStr = string.Format("delete from T_Session where SESSIONID='{0}'", model.SessionId); return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 单条插入 /// </summary> /// <param name="version"></param> /// <returns></returns> public int Insert(string version) { var sqlStr = $"INSERT INTO C_Version(VERSION) VALUES ('{version}')"; return(!string.IsNullOrEmpty(sqlStr) ? AntSdkSqliteHelper.ExecuteNonQuery(sqlStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId) : 0); }
/// <summary> /// 更新 /// </summary> /// <param name="version"></param> /// <returns></returns> public int Update(string version) { var updateStr = $"update C_Version set VERSION='{version}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(updateStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId)); }
/// <summary> /// 单条插入 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Insert(AntSdkGroupInfo model) { var sqlStr = GetInsertSqlStr(model); return(!string.IsNullOrEmpty(sqlStr) ? AntSdkSqliteHelper.ExecuteNonQuery(sqlStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdkService.AntSdkLoginOutput.userId) : 0); }
public int Delete(AntSdkMassMsgCtt model) { string deleteStr = $"delete from T_MassMsg where MESSAGEID='{model.messageId}'"; return(AntSdkSqliteHelper.ExecuteNonQuery(deleteStr, AntSdkService.AntSdkConfigInfo.AntSdkCompanyCode, AntSdk.AntSdkService.AntSdkCurrentUserInfo.userId)); }