Esempio n. 1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_BE">要修改的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RUpdate(BaseEntity p_BE, IDBTransAccess sqlTrans)
        {
            try
            {
                this.CheckCorrect(p_BE);
                FiledSet    entity  = (FiledSet)p_BE;
                FiledSetCtl control = new FiledSetCtl(sqlTrans);

                string sql = "SELECT Name FROM Sys_FiledSet WHERE Name=" + SysString.ToDBString(entity.Name);
                sql += " AND FormID=" + SysString.ToDBString(entity.FormID);
                sql += " AND FAID=" + SysString.ToDBString(entity.FAID);
                sql += " AND FBID=" + SysString.ToDBString(entity.FBID);
                sql += " AND ID<>" + entity.ID;
                DataTable dt = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("名称已存在,请检查");
                }

                control.Update(entity);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="p_BE">要删除的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RDelete(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         FiledSet    entity  = (FiledSet)p_BE;
         FiledSetCtl control = new FiledSetCtl(sqlTrans);
         control.Delete(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }