Exemple #1
0
        public void Update(HPS.BLL.TrafficPicturesBLL.BLLTrafficPictures_T businessObject, HPS.BLL.TrafficPicturesBLL.BLLTrafficPictures_TKeys businessObjectKey)
        {
            try
            {
                List <string> ExceptList = new List <string>();
                if (businessObject.TrafficID_bint == businessObjectKey.TrafficID_bint)
                {
                    ExceptList.Add("UniqueTrafficID_bint");
                }

                if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, ExceptList.ToArray()) == false)
                {
                    throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                }

                _dataObject.Update(businessObject, businessObjectKey);
                // if (businessObject.Picture_vbnry != null)
                // {
                //     File.WriteAllBytes($@"{BLLTrafficPictures_T.TrafficPicturePath}{businessObject.TrafficID_bint}.jpg", businessObject.Picture_vbnry);
                // }
            }
            catch (System.Exception ex)
            {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }
Exemple #2
0
        public void Insert(HPS.BLL.TrafficPicturesBLL.BLLTrafficPictures_T businessObject)
        {
            try
            {
                if (businessObject.IsValid() == false)
                {
                    throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                }

                _dataObject.Insert(businessObject);
                // if (businessObject.Picture_vbnry != null)
                // {
                //     File.WriteAllBytes($@"{BLLTrafficPictures_T.TrafficPicturePath}{businessObject.TrafficID_bint}.jpg", businessObject.Picture_vbnry);
                // }
            }
            catch (System.Exception ex)
            {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }