Example #1
0
        /// <summary>
        /// 保存字典项
        /// </summary>
        /// <param name="dItem"></param>
        /// <returns></returns>
        public static bool SaveItem(DictItem dItem)
        {
            try
            {
                Environment.NhibernateHelper.SaveObject(dItem);
                Environment.NhibernateHelper.Flush();

                if (dItem.Parent != null)
                {
                    ReLoadItem(dItem.Parent);
                }

                return(true);
            }
            catch (Exception exp)
            {
                Environment.Logger.AppendMessage(Define.enumLogType.Error, string.Format("保存字典时出错:{0}", exp.ToString()));

                return(false);
            }
        }
Example #2
0
 public static void ReLoadItem(DictItem dItem)
 {
     Environment.NhibernateHelper.RefreshObject(dItem, Define.enumLockMode.UpgradeNoWait);
 }