Example #1
0
 public void SubmitForm(SupplierInfoEntity entity)
 {
     if (string.IsNullOrWhiteSpace(entity.F_Id))
     {
         entity.Create();
         repository.Insert(entity);
     }
     else
     {
         entity.Modify(entity.F_Id);
         repository.Update(entity);
     }
 }
Example #2
0
 public bool Delete(Guid Id)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         SupplierInfoEntity _SupplierInfoEntity = new SupplierInfoEntity(Id);
         if (adapter.FetchEntity(_SupplierInfoEntity))
         {
             adapter.DeleteEntity(_SupplierInfoEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
Example #3
0
 public ActionResult SubmitForm(SupplierInfoEntity entity, string keyValue)
 {
     entity.F_Id = keyValue;
     app.SubmitForm(entity);
     return(Success("操作成功"));
 }
Example #4
0
        public SupplierInfoEntity Insert(string Phone, string CountryCode, string CityCode, string DistrictCode, string Address, string AboutContents, string Lat, string Lng, int Zoom)
        {
            SupplierInfoEntity _SupplierInfoEntity = new SupplierInfoEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _SupplierInfoEntity.Phone = Phone;
                _SupplierInfoEntity.CountryCode = CountryCode;
                _SupplierInfoEntity.CityCode = CityCode;
                _SupplierInfoEntity.DistrictCode = DistrictCode;
                _SupplierInfoEntity.Address = Address;
                _SupplierInfoEntity.AboutContents = AboutContents;
                _SupplierInfoEntity.Lat = Lat;
                _SupplierInfoEntity.Lng = Lng;
                _SupplierInfoEntity.Zoom = Zoom;
                adapter.SaveEntity(_SupplierInfoEntity, true);
            }
            return _SupplierInfoEntity;
        }
Example #5
0
 public SupplierInfoEntity Insert(SupplierInfoEntity _SupplierInfoEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_SupplierInfoEntity, true);
     }
     return _SupplierInfoEntity;
 }
Example #6
0
        public bool Update(Guid Id, string Phone, string CountryCode, string CityCode, string DistrictCode, string Address, string AboutContents, string Lat, string Lng, int Zoom)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                SupplierInfoEntity _SupplierInfoEntity = new SupplierInfoEntity(Id);
                if (adapter.FetchEntity(_SupplierInfoEntity))
                {

                    _SupplierInfoEntity.Phone = Phone;
                    _SupplierInfoEntity.CountryCode = CountryCode;
                    _SupplierInfoEntity.CityCode = CityCode;
                    _SupplierInfoEntity.DistrictCode = DistrictCode;
                    _SupplierInfoEntity.Address = Address;
                    _SupplierInfoEntity.AboutContents = AboutContents;
                    _SupplierInfoEntity.Lat = Lat;
                    _SupplierInfoEntity.Lng = Lng;
                    _SupplierInfoEntity.Zoom = Zoom;
                    adapter.SaveEntity(_SupplierInfoEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
Example #7
0
 public bool Update(SupplierInfoEntity _SupplierInfoEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_SupplierInfoEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Example #8
0
        public bool Update(SupplierInfoEntity _SupplierInfoEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(SupplierInfoFields.Id == _SupplierInfoEntity.Id);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_SupplierInfoEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
Example #9
0
 public SupplierInfoEntity SelectOne(Guid Id)
 {
     SupplierInfoEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         SupplierInfoEntity _SupplierInfoEntity = new SupplierInfoEntity(Id);
         if (adapter.FetchEntity(_SupplierInfoEntity))
         {
             toReturn = _SupplierInfoEntity;
         }
     }
     return toReturn;
 }