Пример #1
0
        public void Update_ValidDat_NoEx()
        {
            using (var trans = TransHelper.NewScope())
            {
                //  arrang
                var expected = JenisBrgDataFactory();

                //  act
                _jenisBrgDal.Update(expected);

                //  assert
            }
        }
Пример #2
0
        public JenisBrgModel Save(JenisBrgModel jenisBrg)
        {
            //  validasi
            var result = jenisBrg;

            result = TryValidate(jenisBrg);

            //  save
            var dummyJenisBrg = _jenisBrgDal.GetData(jenisBrg.JenisBrgID);

            if (dummyJenisBrg == null)
            {
                _jenisBrgDal.Insert(result);
            }
            else
            {
                _jenisBrgDal.Update(result);
            }
            return(result);
        }