Exemple #1
0
 public virtual bool Insert(SMC_Role role)
 {
     try
     {
         SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
         if (autoDao.HasMaxID("SMC_Role"))
         {
             int max_id = autoDao.GetMaxID("SMC_Role");
             role.Role_ID = max_id + 1;
         }
         else
         {
             role.Role_ID = 1;
         }
         int i = SMC_RoleDao.Insert(role);
         if (i > 0)
         {
             autoDao.UpdateMaxID("SMC_Role");
         }
         return(i > 0);
     }
     catch (DalException ex)
     {
         throw new BOException("调用方法Insert失败", ex);
     }
 }
Exemple #2
0
 public virtual int Save(SMC_Role entity)
 {
     if (SMC_RoleDao.Get(entity.Role_ID) == null)
     {
         return(SMC_RoleDao.Insert(entity));
     }
     else
     {
         return(SMC_RoleDao.Update(entity));
     }
 }
Exemple #3
0
 public virtual void DeleteList(IList <SMC_Role> entities)
 {
     try
     {
         SMC_RoleDao.DeleteList(entities);
     }
     catch (DalException ex)
     {
         throw new BOException("????????????????", ex);
     }
 }
Exemple #4
0
 public virtual void Delete(SMC_Role entity)
 {
     try
     {
         SMC_RoleDao.Delete(entity);
     }
     catch (DalException ex)
     {
         throw new BOException("????????????", ex);
     }
 }
Exemple #5
0
 public virtual bool Update(SMC_Role role)
 {
     try
     {
         int i = SMC_RoleDao.Update(role);
         return(i > 0);
     }
     catch (DalException ex)
     {
         throw new BOException("调用方法Update失败", ex);
     }
 }
Exemple #6
0
 public virtual JsonFlexiGridData QueryRolesByUnitID(PageView view, string Unit_ID)
 {
     return(SMC_RoleDao.QueryRolesByUnitID(view, Unit_ID));
 }
Exemple #7
0
 public virtual SMC_Role Get(int Role_ID)
 {
     return(SMC_RoleDao.Get(Role_ID));
 }