/// <summary> /// /// </summary> /// <param name="objLiveChatAgentInfo"></param> public void UpdateLiveChatAgent(LiveChatAgentInfo objLiveChatAgentInfo) { Requires.NotNull(objLiveChatAgentInfo); Requires.PropertyNotNegative(objLiveChatAgentInfo, "LiveChatID"); Requires.PropertyNotNegative(objLiveChatAgentInfo, "UserID"); using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository <LiveChatAgentInfo>(); rep.Update(objLiveChatAgentInfo); } DataCache.ClearCache(CachePrefix); }
/// <summary> /// /// </summary> /// <param name="livechatAgentID"></param> public void DeleteLiveChatAgent(int livechatAgentID) { Requires.NotNegative("livechatAgentID", livechatAgentID); LiveChatAgentInfo objLiveChatAgentInfo = GetLiveChatAgentByID(livechatAgentID); Requires.NotNull(objLiveChatAgentInfo); using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository <LiveChatAgentInfo>(); rep.Delete(objLiveChatAgentInfo); } DataCache.ClearCache(CachePrefix); }
/// <summary> /// /// </summary> /// <param name="objLiveChatAgentInfo"></param> /// <returns></returns> public int AddLiveChatAgent(LiveChatAgentInfo objLiveChatAgentInfo) { objLiveChatAgentInfo.LeftDate = DateTime.MaxValue; Requires.NotNull(objLiveChatAgentInfo); Requires.PropertyNotNegative(objLiveChatAgentInfo, "LiveChatID"); Requires.PropertyNotNegative(objLiveChatAgentInfo, "UserID"); using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository <LiveChatAgentInfo>(); rep.Insert(objLiveChatAgentInfo); DataCache.ClearCache(CachePrefix); return(objLiveChatAgentInfo.LiveChatID); } }