public int Save(PembayaranKasbon obj)
        {
            var result = 0;

            try
            {
                if (obj.pembayaran_kasbon_id == null)
                {
                    obj.pembayaran_kasbon_id = _context.GetGUID();
                }

                _context.db.Insert <PembayaranKasbon>(obj);

                LogicalThreadContext.Properties["NewValue"] = obj.ToJson();
                _log.Info("Tambah data");

                result = 1;
            }
            catch (Exception ex)
            {
                _log.Error("Error:", ex);
            }

            return(result);
        }
        public int Delete(PembayaranKasbon obj)
        {
            var result = 0;

            try
            {
                result = _context.db.Delete <PembayaranKasbon>(obj) ? 1 : 0;

                if (result > 0)
                {
                    LogicalThreadContext.Properties["OldValue"] = obj.ToJson();
                    _log.Info("Hapus data");
                }
            }
            catch (Exception ex)
            {
                _log.Error("Error:", ex);
            }

            return(result);
        }
        public int Update(PembayaranKasbon obj)
        {
            var result = 0;

            try
            {
                var api      = "update";
                var response = RestSharpHelper <OpenRetailWebApiPostResponse> .PostRequest(_apiUrl, api, obj.ToJson());

                result = Convert.ToInt32(response.Results);
            }
            catch (Exception ex)
            {
                _log.Error("Error:", ex);
            }

            return(result);
        }