Example #1
0
        public bool UpdateInfo(Base_DictionaryInfo info)
        {
            var query = from item in dc.Base_DictionaryInfo
                        where item.DictionaryInfo_ID == info.DictionaryInfo_ID
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
Example #2
0
        /// <summary>
        ///   验证记录中是否有重复值
        /// </summary>
        /// <param name="info"> 实体 </param>
        /// <returns> 如果不重复返回"" </returns>
        public string ValidateRepeat(Base_DictionaryInfo info)
        {
            int cnt1 =
                dc.Base_DictionaryInfo.Where(
                    itm => itm.TypeCode == info.TypeCode && itm.ValueCode == info.ValueCode && itm.DictionaryInfo_ID != info.DictionaryInfo_ID).Count();

            if (cnt1 > 0)
            {
                return("字典类型码重复");
            }
            int cnt2 =
                dc.Base_DictionaryInfo.Where(
                    itm => itm.TypeCode == info.TypeCode && itm.ValueName == info.ValueName && itm.DictionaryInfo_ID != info.DictionaryInfo_ID).Count();

            if (cnt2 > 0)
            {
                return("字典代码重复");
            }
            return("");
        }
Example #3
0
 partial void DeleteBase_DictionaryInfo(Base_DictionaryInfo instance);
Example #4
0
 partial void UpdateBase_DictionaryInfo(Base_DictionaryInfo instance);
Example #5
0
 partial void InsertBase_DictionaryInfo(Base_DictionaryInfo instance);
Example #6
0
 public int InsertInfo(Base_DictionaryInfo info)
 {
     dc.Base_DictionaryInfo.InsertOnSubmit(info);
     dc.SubmitChanges();
     return(info.DictionaryInfo_ID);
 }