public void Insert(HPS.BLL.PortPlacesBLL.BLLPortPlaces_T businessObject) { try { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "PortPlacesID_int") == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } _dataObject.Insert(businessObject); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Update(HPS.BLL.PortPlacesBLL.BLLPortPlaces_T businessObject, HPS.BLL.PortPlacesBLL.BLLPortPlaces_TKeys businessObjectKey) { try { HPS.BLL.PortPlacesBLL.BLLPortPlaces_T tmpPortPlace = this.GetBy(businessObjectKey); List <string> Except = new List <string>(); if (businessObject.PortPlacesID_int == businessObjectKey.PortPlacesID_int) { Except.Add("UniquePortPlacesID_int"); } if (businessObject.PortPlaces_nvc == tmpPortPlace.PortPlaces_nvc) { Except.Add("UniquePortPlaces_nvc"); } if (Except.Count > 0) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, Except.ToArray()) == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } } else { if (businessObject.IsValid() == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } } _dataObject.Update(businessObject, businessObjectKey); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }