public void Update_ValidDat_NoEx()
        {
            using (var trans = TransHelper.NewScope())
            {
                //  arrang
                var expected = SubJenisBrgDataFactory();

                //  act
                _subJenisBrgDal.Update(expected);

                //  assert
            }
        }
Example #2
0
        public SubJenisBrgModel Save(SubJenisBrgModel subJenisBrg)
        {
            //  validasi
            var result = subJenisBrg;

            result = TryValidate(subJenisBrg);

            //  save
            var dummySubJenisBrg = _subJenisBrgDal.GetData(subJenisBrg.SubJenisBrgID);

            if (dummySubJenisBrg == null)
            {
                _subJenisBrgDal.Insert(result);
            }
            else
            {
                _subJenisBrgDal.Update(result);
            }

            return(result);
        }