internal Resource NewResource() { var s = QM.QueryString(Connection, "select g.id_global from v_global_obor g minus select r.global_id from smz_obor_resource r", null); var globalId = Convert.ToInt64(s); var resourceId = SmzResourcePkg.GetOborResourceId(Connection, globalId, null); var r = new Resource(GRPOConnection, resourceId) { PdrId = NewPdrId() }; return(new Resource(Connection, r.Id)); }