Example #1
0
        public void Update(HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T businessObject, HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys businessObjectKey)
        {
            try
            {
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T tmpInfractionGroup = this.GetBy(businessObjectKey);
                List <string> Except = new List <string>();
                if (businessObject.InfractionGroupID_int == businessObjectKey.InfractionGroupID_int)
                {
                    Except.Add("UniqueInfractionGroupID_int");
                }
                if (businessObject.InfractionGroup_nvc == tmpInfractionGroup.InfractionGroup_nvc)
                {
                    Except.Add("UniqueInfractionGroup_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);
            }
        }
Example #2
0
        public void Insert(HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T businessObject)
        {
            try
            {
                if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "InfractionGroupID_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);
            }
        }