/// <summary> /// /// </summary> /// <param name="livechatDepartmentID"></param> public void DeleteLiveChatDepartment(int livechatDepartmentID) { Requires.NotNegative("livechatDepartmentID", livechatDepartmentID); LiveChatDepartmentInfo objLiveChatDepartmentInfo = GetLiveChatDepartmentByID(livechatDepartmentID); Requires.NotNull(objLiveChatDepartmentInfo); using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository <LiveChatDepartmentInfo>(); rep.Delete(objLiveChatDepartmentInfo); } DataCache.ClearCache(CachePrefix); }
/// <summary> /// /// </summary> /// <param name="objLiveChatDepartmentInfo"></param> /// <returns></returns> public int AddLiveChatDepartment(LiveChatDepartmentInfo objLiveChatDepartmentInfo) { Requires.NotNull(objLiveChatDepartmentInfo); Requires.PropertyNotNegative(objLiveChatDepartmentInfo, "LiveChatID"); Requires.PropertyNotNegative(objLiveChatDepartmentInfo, "DepartmentID"); using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository <LiveChatDepartmentInfo>(); rep.Insert(objLiveChatDepartmentInfo); DataCache.ClearCache(CachePrefix); return(objLiveChatDepartmentInfo.LiveChatID); } }