Exemplo n.º 1
0
        public void Insert(HPS.BLL.LadeCommentBLL.BLLLadeComment_T businessObject)
        {
            try
            {
                if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "LadeCommentID_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);
            }
        }
Exemplo n.º 2
0
        public void Update(HPS.BLL.LadeCommentBLL.BLLLadeComment_T businessObject, HPS.BLL.LadeCommentBLL.BLLLadeComment_TKeys businessObjectKey)
        {
            try
            {
                HPS.BLL.LadeCommentBLL.BLLLadeComment_T tmpBill = this.GetBy(businessObjectKey);
                List <string> Except = new List <string>();
                if (businessObject.LadeCommentID_int == businessObjectKey.LadeCommentID_int)
                {
                    Except.Add("UniqueLadeCommentID_int");
                }
                if (businessObject.LadeComment_nvc == tmpBill.LadeComment_nvc)
                {
                    Except.Add("UniqueLadeComment_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);
            }
        }