Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
            }
        }