Esempio n. 1
0
        public int Add(Dic d)
        {
            if (HasDicCode(d.Code))
            {
                return(0); //字典编码已存在
            }

            int i = DicDal.Instance.Insert(d);

            if (i > 0)
            {
                LogBll <Dic> log = new LogBll <Dic>();
                d.KeyId = i;
                log.AddLog(d);
            }
            return(i);
        }
Esempio n. 2
0
        public int Add(Dic d)
        {
            if (HasDicCode(d.Code))
            {
                return(0); //字典编码已存在
            }

            int i = DicDal.Instance.Insert(d);

            if (i > 0)
            {
                if (d.IsDefault == 1)
                {
                    DicDal.Instance.UpdateDefaultState(i);
                }

                LogBll <Dic> log = new LogBll <Dic>();
                d.KeyId = i;
                log.AddLog(d);
            }
            return(i);
        }