Exemple #1
0
 public bool Delete(Guid SupplierId, string UserName)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         SupplierAccountEntity _SupplierAccountEntity = new SupplierAccountEntity(SupplierId, UserName);
         if (adapter.FetchEntity(_SupplierAccountEntity))
         {
             adapter.DeleteEntity(_SupplierAccountEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
Exemple #2
0
        public bool Update(Guid SupplierId, string UserName, bool IsFullAccess)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                SupplierAccountEntity _SupplierAccountEntity = new SupplierAccountEntity(SupplierId, UserName);
                if (adapter.FetchEntity(_SupplierAccountEntity))
                {

                    _SupplierAccountEntity.IsFullAccess = IsFullAccess;
                    adapter.SaveEntity(_SupplierAccountEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
Exemple #3
0
 public bool Update(SupplierAccountEntity _SupplierAccountEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_SupplierAccountEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Exemple #4
0
        public bool Update(SupplierAccountEntity _SupplierAccountEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(SupplierAccountFields.SupplierId == _SupplierAccountEntity.SupplierId);
                    _PredicateExpression.Add(SupplierAccountFields.UserName == _SupplierAccountEntity.UserName);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_SupplierAccountEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
Exemple #5
0
 public SupplierAccountEntity SelectOne(Guid SupplierId, string UserName)
 {
     SupplierAccountEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         SupplierAccountEntity _SupplierAccountEntity = new SupplierAccountEntity(SupplierId, UserName);
         if (adapter.FetchEntity(_SupplierAccountEntity))
         {
             toReturn = _SupplierAccountEntity;
         }
     }
     return toReturn;
 }
Exemple #6
0
        public SupplierAccountEntity Insert(bool IsFullAccess)
        {
            SupplierAccountEntity _SupplierAccountEntity = new SupplierAccountEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _SupplierAccountEntity.IsFullAccess = IsFullAccess;
                adapter.SaveEntity(_SupplierAccountEntity, true);
            }
            return _SupplierAccountEntity;
        }
Exemple #7
0
        public SupplierAccountEntity Insert(Guid SupplierId, string UserName, bool IsFullAccess)
        {
            SupplierAccountEntity _SupplierAccountEntity = new SupplierAccountEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _SupplierAccountEntity.SupplierId = SupplierId;
                _SupplierAccountEntity.UserName = UserName;
                _SupplierAccountEntity.IsFullAccess = IsFullAccess;
                adapter.SaveEntity(_SupplierAccountEntity, true);
            }
            return _SupplierAccountEntity;
        }
Exemple #8
0
 public SupplierAccountEntity Insert(SupplierAccountEntity _SupplierAccountEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_SupplierAccountEntity, true);
     }
     return _SupplierAccountEntity;
 }