Exemple #1
0
 /// <summary>
 /// 从数据库删除指定条件的实体数据
 /// </summary>
 ///  <param name="ConditionForDelete">自定义条件</param>
 public bool DB_DeleteEntity(SQLCondition ConditionForDelete)
 {
     try
     {
         this.IsCreated = false;
         EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());
         return(es.DoDelete(this, ConditionForDelete) > 0 ? true : false);
     }
     catch (Exception exp)
     {
         if (ThrowException)
         {
             throw exp;
         }
         return(false);
     }
 }
Exemple #2
0
 /// <summary>
 /// 更新实体数据到数据库中
 /// </summary>
 /// <param name="ConditionForUpdate">自定义条件</param>
 public bool DB_UpdateEntity(SQLCondition ConditionForUpdate, params string[] Propertys)
 {
     try
     {
         EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());
         IsCreated = es.DoUpdate(this, ConditionForUpdate, Propertys) > 0 ? true : false;
         return(IsCreated);;
     }
     catch (Exception exp)
     {
         if (ThrowException)
         {
             throw exp;
         }
         return(false);
     }
 }
Exemple #3
0
 /// <summary>
 /// 将实体对象插入数据库
 /// </summary>
 /// <param name="Propertys">自定义字段</param>
 public bool DB_InsertEntity(params string[] Propertys)
 {
     try
     {
         IsCreated = true;
         EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());
         IsCreated = es.DoInsert(this, Propertys) > 0 ? true : false;
         return(IsCreated);
     }
     catch (Exception exp)
     {
         if (ThrowException)
         {
             throw exp;
         }
         return(false);
     }
 }
Exemple #4
0
        public bool FillSelf(SQLCondition Condition)
        {
            EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());

            return(es.DoFillSelf(this, Condition));
        }
Exemple #5
0
        public bool FillSelf <T>(T ID, params string[] FieldNames)
        {
            EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());

            return(es.DoFillSelf(this, ID, FieldNames));
        }
Exemple #6
0
        /// <summary>
        /// 判断指定字段值是否存在
        /// </summary>
        /// <param name="FieldName">字段名</param>
        /// <param name="FieldValue">值</param>
        /// <param name="ConditionForCheckExist">自定义条件</param>
        /// <returns></returns>
        public bool IsExist(string ConditionForCheckExist)
        {
            EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());

            return(es.DoCheckExist(ConditionForCheckExist) > 0 ? true : false);
        }
Exemple #7
0
        /// <summary>
        /// 判断指定字段值是否存在
        /// </summary>
        /// <param name="FieldName">字段名</param>
        /// <param name="FieldValue">值</param>
        /// <param name="ConditionForCheckExist">自定义条件</param>
        /// <returns></returns>
        public bool IsExist(string FieldName, object FieldValue)
        {
            EntityStruct es = EntityStructManager.GetEntityStruct(this.GetType());

            return(es.DoCheckExist(FieldName, FieldValue) > 0 ? true : false);
        }